home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1990-06-27 | 20.9 KB | [TEXT/KAHL] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Tue Jun 26 21:34:04 1990, modified Tue Jun 26 21:34:04 1990, creator Think C, type ASCII, 20761 bytes "SFConvertFile.c" , at 0x5199 348 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [KAHL] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0f 53 46 43 6f 6e 76 | 65 72 74 46 69 6c 65 2e |..SFConv|ertFile.|
|00000010| 63 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |c.......|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 51 19 00 | 00 01 5c a2 ad bd 8c a2 |.....Q..|..\.....|
|00000060| ad bd 8c 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 97 92 00 00 |........|........|
|00000080| 0d 0d 23 69 6e 63 6c 75 | 64 65 09 22 53 46 43 6f |..#inclu|de."SFCo|
|00000090| 6e 76 65 72 74 2e 68 22 | 0d 23 69 6e 63 6c 75 64 |nvert.h"|.#includ|
|000000a0| 65 09 22 53 44 74 79 70 | 65 2e 68 22 0d 23 69 6e |e."SDtyp|e.h".#in|
|000000b0| 63 6c 75 64 65 09 3c 73 | 74 64 69 6f 2e 68 3e 0d |clude.<s|tdio.h>.|
|000000c0| 23 69 6e 63 6c 75 64 65 | 09 3c 73 74 72 69 6e 67 |#include|.<string|
|000000d0| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 09 3c 75 6e |.h>.#inc|lude.<un|
|000000e0| 69 78 2e 68 3e 0d 0d 0d | 42 6f 6f 6c 65 61 6e 09 |ix.h>...|Boolean.|
|000000f0| 4f 70 65 6e 53 46 57 72 | 69 74 65 28 76 6f 69 64 |OpenSFWr|ite(void|
|00000100| 29 3b 0d 42 6f 6f 6c 65 | 61 6e 09 53 65 74 53 46 |);.Boole|an.SetSF|
|00000110| 44 69 72 28 53 74 72 32 | 35 35 2c 20 6c 6f 6e 67 |Dir(Str2|55, long|
|00000120| 20 2a 29 3b 0d 42 6f 6f | 6c 65 61 6e 09 47 65 74 | *);.Boo|lean.Get|
|00000130| 53 46 44 69 72 28 53 74 | 72 32 35 35 20 2a 29 3b |SFDir(St|r255 *);|
|00000140| 0d 42 6f 6f 6c 65 61 6e | 09 43 6c 6f 73 65 53 46 |.Boolean|.CloseSF|
|00000150| 28 76 6f 69 64 29 3b 0d | 42 6f 6f 6c 65 61 6e 09 |(void);.|Boolean.|
|00000160| 75 70 64 61 74 65 4e 65 | 77 53 46 52 65 73 46 69 |updateNe|wSFResFi|
|00000170| 6c 65 28 76 6f 69 64 29 | 3b 0d 0d 0d 42 6f 6f 6c |le(void)|;...Bool|
|00000180| 65 61 6e 09 4f 70 65 6e | 53 46 52 65 61 64 28 76 |ean.Open|SFRead(v|
|00000190| 6f 69 64 29 3b 0d 0d 65 | 78 74 65 72 6e 09 76 6f |oid);..e|xtern.vo|
|000001a0| 69 64 20 20 47 65 74 4d | 75 73 69 63 34 43 5f 50 |id GetM|usic4C_P|
|000001b0| 72 65 66 73 28 76 6f 69 | 64 29 3b 0d 0d 65 78 74 |refs(voi|d);..ext|
|000001c0| 65 72 6e 09 76 6f 69 64 | 09 4f 53 45 72 72 6f 72 |ern.void|.OSError|
|000001d0| 32 28 53 74 72 32 35 35 | 2c 20 53 74 72 32 35 35 |2(Str255|, Str255|
|000001e0| 2c 20 4f 53 45 72 72 29 | 3b 0d 65 78 74 65 72 6e |, OSErr)|;.extern|
|000001f0| 09 76 6f 69 64 09 4f 53 | 45 72 72 6f 72 28 53 74 |.void.OS|Error(St|
|00000200| 72 32 35 35 2c 20 53 74 | 72 32 35 35 29 3b 0d 65 |r255, St|r255);.e|
|00000210| 78 74 65 72 6e 09 76 6f | 69 64 09 50 73 74 72 69 |xtern.vo|id.Pstri|
|00000220| 6e 67 43 6f 70 79 28 63 | 68 61 72 20 2a 2c 20 63 |ngCopy(c|har *, c|
|00000230| 68 61 72 20 2a 29 3b 0d | 65 78 74 65 72 6e 09 76 |har *);.|extern.v|
|00000240| 6f 69 64 09 50 73 74 72 | 69 6e 67 43 61 74 28 63 |oid.Pstr|ingCat(c|
|00000250| 68 61 72 20 2a 2c 20 63 | 68 61 72 20 2a 29 3b 0d |har *, c|har *);.|
|00000260| 65 78 74 65 72 6e 09 76 | 6f 69 64 09 44 6f 4f 53 |extern.v|oid.DoOS|
|00000270| 45 72 72 6f 72 41 6c 65 | 72 74 28 53 74 72 32 35 |ErrorAle|rt(Str25|
|00000280| 35 2c 20 53 74 72 32 35 | 35 29 3b 0d 0d 0d 0d 0d |5, Str25|5);.....|
|00000290| 53 46 52 65 70 6c 79 09 | 09 53 6f 75 6e 64 46 69 |SFReply.|.SoundFi|
|000002a0| 6c 65 52 65 70 6c 79 3b | 0d 53 46 52 65 70 6c 79 |leReply;|.SFReply|
|000002b0| 09 09 4e 65 77 53 6f 75 | 6e 64 46 69 6c 65 52 65 |..NewSou|ndFileRe|
|000002c0| 70 6c 79 3b 0d 57 44 50 | 42 52 65 63 09 09 6d 79 |ply;.WDP|BRec..my|
|000002d0| 57 44 50 61 72 61 6d 42 | 6c 6b 3b 0d 50 6f 69 6e |WDParamB|lk;.Poin|
|000002e0| 74 09 09 77 68 65 72 65 | 3b 0d 46 69 6c 65 50 61 |t..where|;.FilePa|
|000002f0| 72 61 6d 09 66 50 42 3b | 0d 65 78 74 65 72 6e 09 |ram.fPB;|.extern.|
|00000300| 09 6c 6f 6e 67 09 09 09 | 53 6f 75 6e 64 46 69 6c |.long...|SoundFil|
|00000310| 65 44 69 72 49 44 3b 0d | 65 78 74 65 72 6e 09 09 |eDirID;.|extern..|
|00000320| 6c 6f 6e 67 09 09 09 53 | 74 61 72 74 55 70 44 69 |long...S|tartUpDi|
|00000330| 72 49 44 3b 0d 65 78 74 | 65 72 6e 09 09 69 6e 74 |rID;.ext|ern..int|
|00000340| 09 09 09 09 53 46 53 61 | 76 65 56 52 65 66 3b 0d |....SFSa|veVRef;.|
|00000350| 65 78 74 65 72 6e 09 09 | 4f 53 45 72 72 09 09 74 |extern..|OSErr..t|
|00000360| 68 65 45 72 72 3b 0d 0d | 0d 42 6f 6f 6c 65 61 6e |heErr;..|.Boolean|
|00000370| 09 4f 70 65 6e 53 46 57 | 72 69 74 65 28 29 0d 7b |.OpenSFW|rite().{|
|00000380| 0d 09 53 46 54 79 70 65 | 4c 69 73 74 09 74 79 70 |..SFType|List.typ|
|00000390| 65 73 3b 0d 09 65 78 74 | 65 72 6e 09 09 69 6f 50 |es;..ext|ern..ioP|
|000003a0| 61 72 61 6d 09 09 6d 79 | 49 4f 50 61 72 6d 42 6c |aram..my|IOParmBl|
|000003b0| 6b 3b 0d 09 65 78 74 65 | 72 6e 09 09 69 6f 50 61 |k;..exte|rn..ioPa|
|000003c0| 72 61 6d 09 09 4e 65 77 | 50 61 72 6d 42 6c 6b 3b |ram..New|ParmBlk;|
|000003d0| 0d 09 65 78 74 65 72 6e | 09 09 53 74 72 32 35 35 |..extern|..Str255|
|000003e0| 09 09 53 6f 75 6e 64 46 | 69 6c 65 4e 61 6d 65 3b |..SoundF|ileName;|
|000003f0| 0d 09 65 78 74 65 72 6e | 09 09 53 74 72 32 35 35 |..extern|..Str255|
|00000400| 09 09 4e 65 77 53 6f 75 | 6e 64 46 69 6c 65 4e 61 |..NewSou|ndFileNa|
|00000410| 6d 65 3b 0d 09 65 78 74 | 65 72 6e 09 09 69 6e 74 |me;..ext|ern..int|
|00000420| 09 09 09 53 46 4f 55 54 | 50 55 54 74 79 70 65 3b |...SFOUT|PUTtype;|
|00000430| 0d 09 65 78 74 65 72 6e | 09 09 53 74 72 32 35 35 |..extern|..Str255|
|00000440| 09 09 53 46 44 69 72 65 | 63 74 6f 72 79 4e 61 6d |..SFDire|ctoryNam|
|00000450| 65 3b 0d 09 65 78 74 65 | 72 6e 09 09 6c 6f 6e 67 |e;..exte|rn..long|
|00000460| 09 09 09 53 74 61 72 74 | 55 70 44 69 72 49 44 3b |...Start|UpDirID;|
|00000470| 0d 09 65 78 74 65 72 6e | 09 09 6c 6f 6e 67 09 09 |..extern|..long..|
|00000480| 09 53 6f 75 6e 64 46 69 | 6c 65 44 69 72 49 44 3b |.SoundFi|leDirID;|
|00000490| 0d 09 65 78 74 65 72 6e | 09 09 6c 6f 6e 67 09 09 |..extern|..long..|
|000004a0| 09 4e 75 6d 43 68 61 6e | 6e 65 6c 73 3b 0d 09 69 |.NumChan|nels;..i|
|000004b0| 6e 74 09 63 3b 0d 0d 09 | 69 66 20 28 20 53 46 44 |nt.c;...|if ( SFD|
|000004c0| 69 72 65 63 74 6f 72 79 | 4e 61 6d 65 5b 30 5d 20 |irectory|Name[0] |
|000004d0| 21 3d 20 4e 49 4c 20 29 | 20 7b 0d 09 09 69 66 20 |!= NIL )| {...if |
|000004e0| 28 20 21 53 65 74 53 46 | 44 69 72 28 53 46 44 69 |( !SetSF|Dir(SFDi|
|000004f0| 72 65 63 74 6f 72 79 4e | 61 6d 65 2c 20 26 53 6f |rectoryN|ame, &So|
|00000500| 75 6e 64 46 69 6c 65 44 | 69 72 49 44 29 20 29 20 |undFileD|irID) ) |
|00000510| 7b 0d 09 09 09 43 75 72 | 44 69 72 53 74 6f 72 65 |{....Cur|DirStore|
|00000520| 20 3d 20 53 74 61 72 74 | 55 70 44 69 72 49 44 3b | = Start|UpDirID;|
|00000530| 0d 09 09 09 72 65 74 75 | 72 6e 28 46 41 4c 53 45 |....retu|rn(FALSE|
|00000540| 29 3b 0d 09 09 7d 0d 09 | 7d 0d 09 0d 09 2f 2a 20 |);...}..|}..../* |
|00000550| 77 65 20 6b 6e 6f 77 20 | 6e 75 6d 62 65 72 20 6f |we know |number o|
|00000560| 66 20 63 68 61 6e 6e 65 | 6c 73 20 62 79 20 6e 6f |f channe|ls by no|
|00000570| 77 2c 20 66 6f 72 20 46 | 4c 4f 41 54 53 20 61 6e |w, for F|LOATS an|
|00000580| 79 77 61 79 20 2a 2f 0d | 09 69 66 20 28 20 4e 75 |yway */.|.if ( Nu|
|00000590| 6d 43 68 61 6e 6e 65 6c | 73 20 3e 3d 20 32 4c 20 |mChannel|s >= 2L |
|000005a0| 26 26 20 53 46 4f 55 54 | 50 55 54 74 79 70 65 20 |&& SFOUT|PUTtype |
|000005b0| 3d 3d 20 53 44 31 20 29 | 0d 09 09 53 46 4f 55 54 |== SD1 )|...SFOUT|
|000005c0| 50 55 54 74 79 70 65 20 | 3d 20 53 44 32 3b 0d 09 |PUTtype |= SD2;..|
|000005d0| 09 0d 09 50 73 74 72 69 | 6e 67 43 6f 70 79 28 28 |...Pstri|ngCopy((|
|000005e0| 63 68 61 72 20 2a 29 4e | 65 77 53 6f 75 6e 64 46 |char *)N|ewSoundF|
|000005f0| 69 6c 65 4e 61 6d 65 2c | 20 28 63 68 61 72 20 2a |ileName,| (char *|
|00000600| 29 53 6f 75 6e 64 46 69 | 6c 65 4e 61 6d 65 29 3b |)SoundFi|leName);|
|00000610| 0d 09 50 74 6f 43 73 74 | 72 28 28 63 68 61 72 20 |..PtoCst|r((char |
|00000620| 2a 29 4e 65 77 53 6f 75 | 6e 64 46 69 6c 65 4e 61 |*)NewSou|ndFileNa|
|00000630| 6d 65 29 3b 0d 09 63 20 | 3d 20 73 74 72 63 73 70 |me);..c |= strcsp|
|00000640| 6e 28 28 63 68 61 72 20 | 2a 29 4e 65 77 53 6f 75 |n((char |*)NewSou|
|00000650| 6e 64 46 69 6c 65 4e 61 | 6d 65 2c 22 2e 22 29 3b |ndFileNa|me,".");|
|00000660| 0d 09 73 77 69 74 63 68 | 28 53 46 4f 55 54 50 55 |..switch|(SFOUTPU|
|00000670| 54 74 79 70 65 29 20 7b | 0d 09 09 63 61 73 65 09 |Ttype) {|...case.|
|00000680| 49 4e 54 31 36 3a 0d 09 | 09 09 73 74 72 63 70 79 |INT16:..|..strcpy|
|00000690| 28 28 63 68 61 72 20 2a | 29 4e 65 77 53 6f 75 6e |((char *|)NewSoun|
|000006a0| 64 46 69 6c 65 4e 61 6d | 65 2b 63 2c 20 22 2e 49 |dFileNam|e+c, ".I|
|000006b0| 4e 54 31 36 22 29 3b 0d | 09 09 09 62 72 65 61 6b |NT16");.|...break|
|000006c0| 3b 0d 09 09 63 61 73 65 | 09 41 49 46 46 3a 0d 09 |;...case|.AIFF:..|
|000006d0| 09 09 73 74 72 63 70 79 | 28 28 63 68 61 72 20 2a |..strcpy|((char *|
|000006e0| 29 4e 65 77 53 6f 75 6e | 64 46 69 6c 65 4e 61 6d |)NewSoun|dFileNam|
|000006f0| 65 2b 63 2c 20 22 2e 41 | 49 46 22 29 3b 0d 09 09 |e+c, ".A|IF");...|
|00000700| 09 62 72 65 61 6b 3b 0d | 09 09 63 61 73 65 09 53 |.break;.|..case.S|
|00000710| 44 31 3a 0d 09 09 09 73 | 74 72 63 70 79 28 28 63 |D1:....s|trcpy((c|
|00000720| 68 61 72 20 2a 29 4e 65 | 77 53 6f 75 6e 64 46 69 |har *)Ne|wSoundFi|
|00000730| 6c 65 4e 61 6d 65 2b 63 | 2c 20 22 2e 53 44 22 29 |leName+c|, ".SD")|
|00000740| 3b 0d 09 09 09 62 72 65 | 61 6b 3b 0d 09 09 63 61 |;....bre|ak;...ca|
|00000750| 73 65 09 53 44 32 3a 0d | 09 09 09 73 74 72 63 70 |se.SD2:.|...strcp|
|00000760| 79 28 28 63 68 61 72 20 | 2a 29 4e 65 77 53 6f 75 |y((char |*)NewSou|
|00000770| 6e 64 46 69 6c 65 4e 61 | 6d 65 2b 63 2c 20 22 2e |ndFileNa|me+c, ".|
|00000780| 53 44 32 22 29 3b 0d 09 | 09 09 62 72 65 61 6b 3b |SD2");..|..break;|
|00000790| 0d 09 09 63 61 73 65 09 | 46 4c 4f 41 54 3a 0d 09 |...case.|FLOAT:..|
|000007a0| 09 09 73 74 72 63 70 79 | 28 28 63 68 61 72 20 2a |..strcpy|((char *|
|000007b0| 29 4e 65 77 53 6f 75 6e | 64 46 69 6c 65 4e 61 6d |)NewSoun|dFileNam|
|000007c0| 65 2b 63 2c 20 22 2e 46 | 4c 4f 41 54 22 29 3b 0d |e+c, ".F|LOAT");.|
|000007d0| 09 09 09 62 72 65 61 6b | 3b 0d 09 7d 0d 09 53 65 |...break|;..}..Se|
|000007e0| 74 50 74 28 26 77 68 65 | 72 65 2c 20 31 30 30 2c |tPt(&whe|re, 100,|
|000007f0| 20 31 30 30 29 3b 0d 0d | 09 43 74 6f 50 73 74 72 | 100);..|.CtoPstr|
|00000800| 28 28 63 68 61 72 20 2a | 29 4e 65 77 53 6f 75 6e |((char *|)NewSoun|
|00000810| 64 46 69 6c 65 4e 61 6d | 65 29 3b 0d 0d 0d 09 53 |dFileNam|e);....S|
|00000820| 46 50 75 74 46 69 6c 65 | 28 77 68 65 72 65 2c 20 |FPutFile|(where, |
|00000830| 22 5c 70 53 6f 75 6e 64 | 20 46 69 6c 65 20 6e 61 |"\pSound| File na|
|00000840| 6d 65 3a 22 2c 20 26 4e | 65 77 53 6f 75 6e 64 46 |me:", &N|ewSoundF|
|00000850| 69 6c 65 4e 61 6d 65 2c | 20 4e 49 4c 2c 20 26 4e |ileName,| NIL, &N|
|00000860| 65 77 53 6f 75 6e 64 46 | 69 6c 65 52 65 70 6c 79 |ewSoundF|ileReply|
|00000870| 29 3b 0d 09 69 66 28 21 | 4e 65 77 53 6f 75 6e 64 |);..if(!|NewSound|
|00000880| 46 69 6c 65 52 65 70 6c | 79 2e 67 6f 6f 64 29 20 |FileRepl|y.good) |
|00000890| 7b 0d 09 09 72 65 74 75 | 72 6e 28 46 41 4c 53 45 |{...retu|rn(FALSE|
|000008a0| 29 3b 0d 09 7d 0d 09 47 | 65 74 53 46 44 69 72 28 |);..}..G|etSFDir(|
|000008b0| 26 53 46 44 69 72 65 63 | 74 6f 72 79 4e 61 6d 65 |&SFDirec|toryName|
|000008c0| 29 3b 0d 09 2f 2a 20 77 | 65 20 6e 6f 77 20 68 61 |);../* w|e now ha|
|000008d0| 76 65 20 74 68 65 20 64 | 69 72 65 63 74 6f 72 79 |ve the d|irectory|
|000008e0| 20 77 68 65 72 65 20 74 | 68 65 20 73 6f 75 6e 64 | where t|he sound|
|000008f0| 20 66 69 6c 65 20 69 73 | 20 74 6f 20 62 65 20 63 | file is| to be c|
|00000900| 72 65 61 74 65 64 20 2a | 2f 0d 09 53 65 74 53 46 |reated *|/..SetSF|
|00000910| 44 69 72 28 53 46 44 69 | 72 65 63 74 6f 72 79 4e |Dir(SFDi|rectoryN|
|00000920| 61 6d 65 2c 20 26 53 6f | 75 6e 64 46 69 6c 65 44 |ame, &So|undFileD|
|00000930| 69 72 49 44 29 3b 0d 09 | 0d 09 50 73 74 72 69 6e |irID);..|..Pstrin|
|00000940| 67 43 6f 70 79 28 28 63 | 68 61 72 20 2a 29 4e 65 |gCopy((c|har *)Ne|
|00000950| 77 53 6f 75 6e 64 46 69 | 6c 65 4e 61 6d 65 2c 20 |wSoundFi|leName, |
|00000960| 28 63 68 61 72 20 2a 29 | 4e 65 77 53 6f 75 6e 64 |(char *)|NewSound|
|00000970| 46 69 6c 65 52 65 70 6c | 79 2e 66 4e 61 6d 65 29 |FileRepl|y.fName)|
|00000980| 3b 0d 09 4e 65 77 50 61 | 72 6d 42 6c 6b 2e 69 6f |;..NewPa|rmBlk.io|
|00000990| 4e 61 6d 65 50 74 72 20 | 3d 20 28 53 74 72 69 6e |NamePtr |= (Strin|
|000009a0| 67 50 74 72 29 4e 65 77 | 53 6f 75 6e 64 46 69 6c |gPtr)New|SoundFil|
|000009b0| 65 4e 61 6d 65 3b 0d 09 | 4e 65 77 50 61 72 6d 42 |eName;..|NewParmB|
|000009c0| 6c 6b 2e 69 6f 56 52 65 | 66 4e 75 6d 20 3d 20 4e |lk.ioVRe|fNum = N|
|000009d0| 65 77 53 6f 75 6e 64 46 | 69 6c 65 52 65 70 6c 79 |ewSoundF|ileReply|
|000009e0| 2e 76 52 65 66 4e 75 6d | 3b 0d 09 4e 65 77 50 61 |.vRefNum|;..NewPa|
|000009f0| 72 6d 42 6c 6b 2e 69 6f | 56 65 72 73 4e 75 6d 20 |rmBlk.io|VersNum |
|00000a00| 3d 20 4e 65 77 53 6f 75 | 6e 64 46 69 6c 65 52 65 |= NewSou|ndFileRe|
|00000a10| 70 6c 79 2e 76 65 72 73 | 69 6f 6e 3b 0d 0d 09 69 |ply.vers|ion;...i|
|00000a20| 66 20 28 20 28 74 68 65 | 45 72 72 20 3d 20 50 42 |f ( (the|Err = PB|
|00000a30| 43 72 65 61 74 65 28 26 | 4e 65 77 50 61 72 6d 42 |Create(&|NewParmB|
|00000a40| 6c 6b 2c 20 46 41 4c 53 | 45 29 29 20 21 3d 20 6e |lk, FALS|E)) != n|
|00000a50| 6f 45 72 72 20 29 20 7b | 0d 09 09 69 66 20 28 20 |oErr ) {|...if ( |
|00000a60| 74 68 65 45 72 72 20 3d | 3d 20 64 75 70 46 4e 45 |theErr =|= dupFNE|
|00000a70| 72 72 20 29 20 7b 09 2f | 2a 20 73 65 74 20 6c 6f |rr ) {./|* set lo|
|00000a80| 67 69 63 61 6c 20 45 4f | 46 27 73 20 74 6f 20 7a |gical EO|F's to z|
|00000a90| 65 72 6f 20 2a 2f 0d 09 | 09 09 4e 65 77 50 61 72 |ero */..|..NewPar|
|00000aa0| 6d 42 6c 6b 2e 69 6f 50 | 65 72 6d 73 73 6e 20 3d |mBlk.ioP|ermssn =|
|00000ab0| 20 66 73 57 72 50 65 72 | 6d 3b 0d 09 09 09 4e 65 | fsWrPer|m;....Ne|
|00000ac0| 77 50 61 72 6d 42 6c 6b | 2e 69 6f 4d 69 73 63 20 |wParmBlk|.ioMisc |
|00000ad0| 3d 20 28 50 74 72 29 4e | 49 4c 3b 0d 09 09 09 74 |= (Ptr)N|IL;....t|
|00000ae0| 68 65 45 72 72 20 3d 20 | 50 42 4f 70 65 6e 28 26 |heErr = |PBOpen(&|
|00000af0| 4e 65 77 50 61 72 6d 42 | 6c 6b 2c 20 46 41 4c 53 |NewParmB|lk, FALS|
|00000b00| 45 29 3b 0d 09 09 09 69 | 66 20 28 20 74 68 65 45 |E);....i|f ( theE|
|00000b10| 72 72 20 3d 3d 20 6f 70 | 57 72 45 72 72 20 29 20 |rr == op|WrErr ) |
|00000b20| 7b 0d 09 09 09 09 2f 2a | 20 61 6c 72 65 61 64 79 |{...../*| already|
|00000b30| 20 6f 70 65 6e 2c 20 64 | 6f 20 20 6e 6f 74 68 69 | open, d|o nothi|
|00000b40| 6e 67 20 2a 2f 0d 09 09 | 09 7d 0d 09 09 09 65 6c |ng */...|.}....el|
|00000b50| 73 65 20 69 66 20 28 20 | 74 68 65 45 72 72 20 21 |se if ( |theErr !|
|00000b60| 3d 20 6e 6f 45 72 72 20 | 29 20 7b 0d 09 09 09 09 |= noErr |) {.....|
|00000b70| 4f 53 45 72 72 6f 72 32 | 28 22 5c 70 45 72 72 6f |OSError2|("\pErro|
|00000b80| 72 20 6f 70 65 6e 69 6e | 67 20 73 6f 75 6e 64 20 |r openin|g sound |
|00000b90| 66 69 6c 65 3a 20 22 2c | 20 4e 65 77 53 6f 75 6e |file: ",| NewSoun|
|00000ba0| 64 46 69 6c 65 4e 61 6d | 65 2c 20 74 68 65 45 72 |dFileNam|e, theEr|
|00000bb0| 72 29 3b 0d 09 09 09 09 | 72 65 74 75 72 6e 28 46 |r);.....|return(F|
|00000bc0| 41 4c 53 45 29 3b 0d 09 | 09 09 7d 0d 09 09 09 4e |ALSE);..|..}....N|
|00000bd0| 65 77 50 61 72 6d 42 6c | 6b 2e 69 6f 4d 69 73 63 |ewParmBl|k.ioMisc|
|00000be0| 20 3d 20 28 50 74 72 29 | 31 3b 0d 09 09 09 74 68 | = (Ptr)|1;....th|
|00000bf0| 65 45 72 72 20 3d 20 50 | 42 53 65 74 45 4f 46 28 |eErr = P|BSetEOF(|
|00000c00| 26 4e 65 77 50 61 72 6d | 42 6c 6b 2c 20 46 41 4c |&NewParm|Blk, FAL|
|00000c10| 53 45 29 3b 0d 09 09 09 | 69 66 20 28 20 74 68 65 |SE);....|if ( the|
|00000c20| 45 72 72 20 21 3d 20 6e | 6f 45 72 72 20 29 20 7b |Err != n|oErr ) {|
|00000c30| 0d 09 09 09 09 4f 53 45 | 72 72 6f 72 32 28 22 5c |.....OSE|rror2("\|
|00000c40| 70 45 72 72 6f 72 20 73 | 65 74 74 69 6e 67 20 45 |pError s|etting E|
|00000c50| 4f 46 20 66 6f 72 20 73 | 6f 75 6e 64 20 66 69 6c |OF for s|ound fil|
|00000c60| 65 3a 20 22 2c 20 4e 65 | 77 53 6f 75 6e 64 46 69 |e: ", Ne|wSoundFi|
|00000c70| 6c 65 4e 61 6d 65 2c 20 | 74 68 65 45 72 72 29 3b |leName, |theErr);|
|00000c80| 0d 09 09 09 09 72 65 74 | 75 72 6e 28 46 41 4c 53 |.....ret|urn(FALS|
|00000c90| 45 29 3b 0d 09 09 09 7d | 0d 09 09 09 74 68 65 45 |E);....}|....theE|
|00000ca0| 72 72 20 3d 20 50 42 43 | 6c 6f 73 65 28 26 4e 65 |rr = PBC|lose(&Ne|
|00000cb0| 77 50 61 72 6d 42 6c 6b | 2c 20 46 41 4c 53 45 29 |wParmBlk|, FALSE)|
|00000cc0| 3b 0d 09 09 09 69 66 20 | 28 20 74 68 65 45 72 72 |;....if |( theErr|
|00000cd0| 20 21 3d 20 6e 6f 45 72 | 72 20 29 20 7b 0d 09 09 | != noEr|r ) {...|
|00000ce0| 09 09 4f 53 45 72 72 6f | 72 32 28 22 5c 70 45 72 |..OSErro|r2("\pEr|
|00000cf0| 72 6f 72 20 77 68 69 6c | 65 20 73 65 74 74 69 6e |ror whil|e settin|
|00000d00| 67 20 45 4f 46 20 66 6f | 72 20 73 6f 75 6e 64 20 |g EOF fo|r sound |
|00000d10| 66 69 6c 65 3a 20 22 2c | 20 4e 65 77 53 6f 75 6e |file: ",| NewSoun|
|00000d20| 64 46 69 6c 65 4e 61 6d | 65 2c 20 74 68 65 45 72 |dFileNam|e, theEr|
|00000d30| 72 29 3b 0d 09 09 09 09 | 72 65 74 75 72 6e 28 46 |r);.....|return(F|
|00000d40| 41 4c 53 45 29 3b 0d 09 | 09 09 7d 0d 09 09 0d 09 |ALSE);..|..}.....|
|00000d50| 09 09 2f 2a 20 64 6f 20 | 72 65 73 6f 75 72 63 65 |../* do |resource|
|00000d60| 20 66 6f 72 6b 20 2a 2f | 0d 09 09 09 4e 65 77 50 | fork */|....NewP|
|00000d70| 61 72 6d 42 6c 6b 2e 69 | 6f 4d 69 73 63 20 3d 20 |armBlk.i|oMisc = |
|00000d80| 28 50 74 72 29 4e 49 4c | 3b 0d 09 09 09 74 68 65 |(Ptr)NIL|;....the|
|00000d90| 45 72 72 20 3d 20 50 42 | 4f 70 65 6e 52 46 28 26 |Err = PB|OpenRF(&|
|00000da0| 4e 65 77 50 61 72 6d 42 | 6c 6b 2c 20 46 41 4c 53 |NewParmB|lk, FALS|
|00000db0| 45 29 3b 0d 09 09 09 69 | 66 20 28 20 74 68 65 45 |E);....i|f ( theE|
|00000dc0| 72 72 20 21 3d 20 6e 6f | 45 72 72 20 29 20 7b 0d |rr != no|Err ) {.|
|00000dd0| 09 09 09 09 69 66 20 28 | 20 74 68 65 45 72 72 20 |....if (| theErr |
|00000de0| 21 3d 20 6f 70 57 72 45 | 72 72 20 29 20 7b 0d 09 |!= opWrE|rr ) {..|
|00000df0| 09 09 09 09 4f 53 45 72 | 72 6f 72 32 28 22 5c 70 |....OSEr|ror2("\p|
|00000e00| 45 72 72 6f 72 20 6f 70 | 65 6e 69 6e 67 20 73 6f |Error op|ening so|
|00000e10| 75 6e 64 20 66 69 6c 65 | 20 72 65 73 6f 75 72 63 |und file| resourc|
|00000e20| 65 20 66 6f 72 6b 3a 20 | 22 2c 20 53 6f 75 6e 64 |e fork: |", Sound|
|00000e30| 46 69 6c 65 4e 61 6d 65 | 2c 20 74 68 65 45 72 72 |FileName|, theErr|
|00000e40| 29 3b 0d 09 09 09 09 09 | 43 75 72 44 69 72 53 74 |);......|CurDirSt|
|00000e50| 6f 72 65 20 3d 20 53 74 | 61 72 74 55 70 44 69 72 |ore = St|artUpDir|
|00000e60| 49 44 3b 0d 09 09 09 09 | 09 72 65 74 75 72 6e 28 |ID;.....|.return(|
|00000e70| 46 41 4c 53 45 29 3b 0d | 09 09 09 09 7d 0d 09 09 |FALSE);.|....}...|
|00000e80| 09 7d 0d 09 09 09 74 68 | 65 45 72 72 20 3d 20 50 |.}....th|eErr = P|
|00000e90| 42 53 65 74 45 4f 46 28 | 26 4e 65 77 50 61 72 6d |BSetEOF(|&NewParm|
|00000ea0| 42 6c 6b 2c 20 46 41 4c | 53 45 29 3b 0d 09 09 09 |Blk, FAL|SE);....|
|00000eb0| 69 66 20 28 20 74 68 65 | 45 72 72 20 21 3d 20 6e |if ( the|Err != n|
|00000ec0| 6f 45 72 72 20 29 20 7b | 0d 09 09 09 09 4f 53 45 |oErr ) {|.....OSE|
|00000ed0| 72 72 6f 72 32 28 22 5c | 70 45 72 72 6f 72 20 73 |rror2("\|pError s|
|00000ee0| 65 74 74 69 6e 67 20 45 | 4f 46 20 66 6f 72 20 73 |etting E|OF for s|
|00000ef0| 6f 75 6e 64 20 66 69 6c | 65 20 72 65 73 6f 75 72 |ound fil|e resour|
|00000f00| 63 65 20 66 6f 72 6b 3a | 20 22 2c 20 4e 65 77 53 |ce fork:| ", NewS|
|00000f10| 6f 75 6e 64 46 69 6c 65 | 4e 61 6d 65 2c 20 74 68 |oundFile|Name, th|
|00000f20| 65 45 72 72 29 3b 0d 09 | 09 09 09 72 65 74 75 72 |eErr);..|...retur|
|00000f30| 6e 28 46 41 4c 53 45 29 | 3b 0d 09 09 09 7d 0d 09 |n(FALSE)|;....}..|
|00000f40| 09 09 2f 2a 20 63 6c 6f | 73 65 20 72 65 73 6f 75 |../* clo|se resou|
|00000f50| 72 63 65 20 66 6f 72 6b | 20 2a 2f 0d 09 09 09 74 |rce fork| */....t|
|00000f60| 68 65 45 72 72 20 3d 20 | 50 42 43 6c 6f 73 65 28 |heErr = |PBClose(|
|00000f70| 26 4e 65 77 50 61 72 6d | 42 6c 6b 2c 20 46 41 4c |&NewParm|Blk, FAL|
|00000f80| 53 45 29 3b 0d 09 09 09 | 69 66 20 28 20 74 68 65 |SE);....|if ( the|
|00000f90| 45 72 72 20 21 3d 20 6e | 6f 45 72 72 20 29 20 7b |Err != n|oErr ) {|
|00000fa0| 0d 09 09 09 09 4f 53 45 | 72 72 6f 72 32 28 22 5c |.....OSE|rror2("\|
|00000fb0| 70 45 72 72 6f 72 20 77 | 68 69 6c 65 20 73 65 74 |pError w|hile set|
|00000fc0| 74 69 6e 67 20 45 4f 46 | 20 66 6f 72 20 73 6f 75 |ting EOF| for sou|
|00000fd0| 6e 64 20 66 69 6c 65 3a | 20 22 2c 20 4e 65 77 53 |nd file:| ", NewS|
|00000fe0| 6f 75 6e 64 46 69 6c 65 | 4e 61 6d 65 2c 20 74 68 |oundFile|Name, th|
|00000ff0| 65 45 72 72 29 3b 0d 09 | 09 09 09 72 65 74 75 72 |eErr);..|...retur|
|00001000| 6e 28 46 41 4c 53 45 29 | 3b 0d 09 09 09 7d 0d 09 |n(FALSE)|;....}..|
|00001010| 09 09 0d 09 09 7d 0d 09 | 09 65 6c 73 65 20 7b 20 |.....}..|.else { |
|00001020| 2f 2a 20 65 72 72 6f 72 | 20 6f 74 68 65 72 20 74 |/* error| other t|
|00001030| 68 61 6e 20 64 75 70 46 | 4e 65 72 72 20 2a 2f 0d |han dupF|Nerr */.|
|00001040| 09 09 09 4f 53 45 72 72 | 6f 72 32 28 22 5c 70 4f |...OSErr|or2("\pO|
|00001050| 70 65 6e 53 46 57 72 69 | 74 65 20 45 72 72 6f 72 |penSFWri|te Error|
|00001060| 20 63 72 65 61 74 69 6e | 67 20 66 69 6c 65 3a 20 | creatin|g file: |
|00001070| 22 2c 20 4e 65 77 53 6f | 75 6e 64 46 69 6c 65 4e |", NewSo|undFileN|
|00001080| 61 6d 65 2c 20 74 68 65 | 45 72 72 29 3b 0d 09 09 |ame, the|Err);...|
|00001090| 09 72 65 74 75 72 6e 28 | 46 41 4c 53 45 29 3b 0d |.return(|FALSE);.|
|000010a0| 09 09 7d 0d 09 7d 0d 09 | 65 6c 73 65 20 7b 20 2f |..}..}..|else { /|
|000010b0| 2a 20 6e 65 77 20 66 69 | 6c 65 73 20 6f 6e 6c 79 |* new fi|les only|
|000010c0| 20 2a 2f 0d 09 7d 0d 0d | 0d 09 66 50 42 2e 69 6f | */..}..|..fPB.io|
|000010d0| 43 6f 6d 70 6c 65 74 69 | 6f 6e 20 3d 20 28 50 72 |Completi|on = (Pr|
|000010e0| 6f 63 50 74 72 29 4e 49 | 4c 3b 0d 09 66 50 42 2e |ocPtr)NI|L;..fPB.|
|000010f0| 69 6f 4e 61 6d 65 50 74 | 72 20 3d 20 4e 65 77 50 |ioNamePt|r = NewP|
|00001100| 61 72 6d 42 6c 6b 2e 69 | 6f 4e 61 6d 65 50 74 72 |armBlk.i|oNamePtr|
|00001110| 3b 0d 09 66 50 42 2e 69 | 6f 56 52 65 66 4e 75 6d |;..fPB.i|oVRefNum|
|00001120| 20 3d 20 4e 65 77 50 61 | 72 6d 42 6c 6b 2e 69 6f | = NewPa|rmBlk.io|
|00001130| 56 52 65 66 4e 75 6d 3b | 0d 09 66 50 42 2e 69 6f |VRefNum;|..fPB.io|
|00001140| 46 56 65 72 73 4e 75 6d | 20 3d 20 4e 65 77 50 61 |FVersNum| = NewPa|
|00001150| 72 6d 42 6c 6b 2e 69 6f | 56 65 72 73 4e 75 6d 3b |rmBlk.io|VersNum;|
|00001160| 0d 09 66 50 42 2e 69 6f | 46 44 69 72 49 6e 64 65 |..fPB.io|FDirInde|
|00001170| 78 20 3d 20 4e 49 4c 3b | 0d 09 74 68 65 45 72 72 |x = NIL;|..theErr|
|00001180| 20 3d 20 50 42 47 65 74 | 46 49 6e 66 6f 28 26 66 | = PBGet|FInfo(&f|
|00001190| 50 42 2c 20 46 41 4c 53 | 45 29 3b 0d 09 69 66 20 |PB, FALS|E);..if |
|000011a0| 28 20 74 68 65 45 72 72 | 20 21 3d 20 6e 6f 45 72 |( theErr| != noEr|
|000011b0| 72 20 29 20 7b 0d 09 09 | 4f 53 45 72 72 6f 72 32 |r ) {...|OSError2|
|000011c0| 28 22 5c 70 4f 70 65 6e | 53 46 57 72 69 74 65 20 |("\pOpen|SFWrite |
|000011d0| 45 72 72 6f 72 20 67 65 | 74 74 69 6e 67 20 50 42 |Error ge|tting PB|
|000011e0| 47 65 74 46 49 6e 66 6f | 20 77 68 69 6c 65 20 6f |GetFInfo| while o|
|000011f0| 70 65 6e 69 6e 67 20 66 | 69 6c 65 3a 20 22 2c 20 |pening f|ile: ", |
|00001200| 4e 65 77 53 6f 75 6e 64 | 46 69 6c 65 4e 61 6d 65 |NewSound|FileName|
|00001210| 2c 20 74 68 65 45 72 72 | 29 3b 0d 09 09 72 65 74 |, theErr|);...ret|
|00001220| 75 72 6e 28 46 41 4c 53 | 45 29 3b 0d 09 7d 0d 09 |urn(FALS|E);..}..|
|00001230| 0d 09 2f 2a 20 73 65 74 | 20 63 72 65 61 74 6f 72 |../* set| creator|
|00001240| 20 2a 2f 0d 09 66 50 42 | 2e 69 6f 46 6c 46 6e 64 | */..fPB|.ioFlFnd|
|00001250| 72 49 6e 66 6f 2e 66 64 | 43 72 65 61 74 6f 72 20 |rInfo.fd|Creator |
|00001260| 3d 20 27 4d 55 34 43 27 | 3b 0d 2f 2a 09 66 50 42 |= 'MU4C'|;./*.fPB|
|00001270| 2e 69 6f 46 6c 46 6e 64 | 72 49 6e 66 6f 2e 66 64 |.ioFlFnd|rInfo.fd|
|00001280| 43 72 65 61 74 6f 72 20 | 3d 20 27 53 46 49 4e 27 |Creator |= 'SFIN'|
|00001290| 3b 20 20 69 2e 65 2e 20 | 53 46 49 6e 66 6f 20 2a |; i.e. |SFInfo *|
|000012a0| 2f 0d 09 73 77 69 74 63 | 68 28 53 46 4f 55 54 50 |/..switc|h(SFOUTP|
|000012b0| 55 54 74 79 70 65 29 20 | 7b 0d 09 09 63 61 73 65 |UTtype) |{...case|
|000012c0| 09 49 4e 54 31 36 3a 0d | 09 09 09 66 50 42 2e 69 |.INT16:.|...fPB.i|
|000012d0| 6f 46 6c 46 6e 64 72 49 | 6e 66 6f 2e 66 64 54 79 |oFlFndrI|nfo.fdTy|
|000012e0| 70 65 20 3d 20 27 49 4c | 31 36 27 3b 0d 09 09 09 |pe = 'IL|16';....|
|000012f0| 62 72 65 61 6b 3b 0d 09 | 09 63 61 73 65 09 41 49 |break;..|.case.AI|
|00001300| 46 46 3a 0d 09 09 09 66 | 50 42 2e 69 6f 46 6c 46 |FF:....f|PB.ioFlF|
|00001310| 6e 64 72 49 6e 66 6f 2e | 66 64 54 79 70 65 20 3d |ndrInfo.|fdType =|
|00001320| 20 27 41 49 46 46 27 3b | 0d 09 09 09 62 72 65 61 | 'AIFF';|....brea|
|00001330| 6b 3b 0d 09 09 63 61 73 | 65 09 53 44 31 3a 0d 09 |k;...cas|e.SD1:..|
|00001340| 09 09 66 50 42 2e 69 6f | 46 6c 46 6e 64 72 49 6e |..fPB.io|FlFndrIn|
|00001350| 66 6f 2e 66 64 54 79 70 | 65 20 3d 20 27 53 46 49 |fo.fdTyp|e = 'SFI|
|00001360| 4c 27 3b 0d 09 09 09 66 | 50 42 2e 69 6f 46 6c 46 |L';....f|PB.ioFlF|
|00001370| 6e 64 72 49 6e 66 6f 2e | 66 64 43 72 65 61 74 6f |ndrInfo.|fdCreato|
|00001380| 72 20 3d 20 27 58 46 45 | 52 27 3b 0d 09 09 09 2f |r = 'XFE|R';..../|
|00001390| 2a 20 63 68 65 63 6b 20 | 66 6f 72 20 53 44 32 20 |* check |for SD2 |
|000013a0| 66 69 6c 65 20 2a 2f 0d | 09 09 09 2f 2a 20 66 50 |file */.|.../* fP|
|000013b0| 42 2e 69 6f 46 6c 46 6e | 64 72 49 6e 66 6f 2e 66 |B.ioFlFn|drInfo.f|
|000013c0| 64 54 79 70 65 20 3d 20 | 27 53 64 32 66 27 3b 20 |dType = |'Sd2f'; |
|000013d0| 2a 2f 0d 09 09 09 62 72 | 65 61 6b 3b 0d 09 09 63 |*/....br|eak;...c|
|000013e0| 61 73 65 09 53 44 32 3a | 0d 09 09 09 66 50 42 2e |ase.SD2:|....fPB.|
|000013f0| 69 6f 46 6c 46 6e 64 72 | 49 6e 66 6f 2e 66 64 54 |ioFlFndr|Info.fdT|
|00001400| 79 70 65 20 3d 20 27 53 | 64 32 66 27 3b 0d 09 09 |ype = 'S|d2f';...|
|00001410| 09 66 50 42 2e 69 6f 46 | 6c 46 6e 64 72 49 6e 66 |.fPB.ioF|lFndrInf|
|00001420| 6f 2e 66 64 43 72 65 61 | 74 6f 72 20 3d 20 27 53 |o.fdCrea|tor = 'S|
|00001430| 64 32 61 27 3b 0d 09 09 | 09 62 72 65 61 6b 3b 0d |d2a';...|.break;.|
|00001440| 09 09 63 61 73 65 09 46 | 4c 4f 41 54 3a 0d 09 09 |..case.F|LOAT:...|
|00001450| 09 66 50 42 2e 69 6f 46 | 6c 46 6e 64 72 49 6e 66 |.fPB.ioF|lFndrInf|
|00001460| 6f 2e 66 64 54 79 70 65 | 20 3d 20 27 54 45 58 54 |o.fdType| = 'TEXT|
|00001470| 27 3b 0d 09 09 09 62 72 | 65 61 6b 3b 0d 09 7d 0d |';....br|eak;..}.|
|00001480| 0d 09 66 50 42 2e 69 6f | 46 6c 46 6e 64 72 49 6e |..fPB.io|FlFndrIn|
|00001490| 66 6f 2e 66 64 46 6c 61 | 67 73 20 3d 20 4e 49 4c |fo.fdFla|gs = NIL|
|000014a0| 3b 0d 09 74 68 65 45 72 | 72 20 3d 20 50 42 53 65 |;..theEr|r = PBSe|
|000014b0| 74 46 49 6e 66 6f 28 26 | 66 50 42 2c 20 46 41 4c |tFInfo(&|fPB, FAL|
|000014c0| 53 45 29 3b 0d 09 69 66 | 20 28 20 74 68 65 45 72 |SE);..if| ( theEr|
|000014d0| 72 20 21 3d 20 6e 6f 45 | 72 72 20 29 20 7b 0d 09 |r != noE|rr ) {..|
|000014e0| 09 4f 53 45 72 72 6f 72 | 32 28 22 5c 70 4f 70 65 |.OSError|2("\pOpe|
|000014f0| 6e 53 46 57 72 69 74 65 | 20 45 72 72 6f 72 20 73 |nSFWrite| Error s|
|00001500| 65 74 74 69 6e 67 20 50 | 42 47 65 74 46 49 6e 66 |etting P|BGetFInf|
|00001510| 6f 20 77 68 69 6c 65 20 | 6f 70 65 6e 69 6e 67 20 |o while |opening |
|00001520| 66 69 6c 65 3a 20 22 2c | 20 4e 65 77 53 6f 75 6e |file: ",| NewSoun|
|00001530| 64 46 69 6c 65 4e 61 6d | 65 2c 20 74 68 65 45 72 |dFileNam|e, theEr|
|00001540| 72 29 3b 0d 09 09 72 65 | 74 75 72 6e 28 46 41 4c |r);...re|turn(FAL|
|00001550| 53 45 29 3b 0d 09 7d 0d | 09 50 42 46 6c 75 73 68 |SE);..}.|.PBFlush|
|00001560| 56 6f 6c 28 26 66 50 42 | 2c 20 46 41 4c 53 45 29 |Vol(&fPB|, FALSE)|
|00001570| 3b 0d 09 0d 09 2f 2a 20 | 6e 6f 77 20 6f 70 65 6e |;..../* |now open|
|00001580| 20 69 74 20 2a 2f 0d 09 | 4e 65 77 50 61 72 6d 42 | it */..|NewParmB|
|00001590| 6c 6b 2e 69 6f 50 65 72 | 6d 73 73 6e 20 3d 20 66 |lk.ioPer|mssn = f|
|000015a0| 73 57 72 50 65 72 6d 3b | 0d 09 4e 65 77 50 61 72 |sWrPerm;|..NewPar|
|000015b0| 6d 42 6c 6b 2e 69 6f 4d | 69 73 63 20 3d 20 28 50 |mBlk.ioM|isc = (P|
|000015c0| 74 72 29 30 4c 3b 0d 09 | 69 66 20 28 20 28 74 68 |tr)0L;..|if ( (th|
|000015d0| 65 45 72 72 20 3d 20 50 | 42 4f 70 65 6e 28 26 4e |eErr = P|BOpen(&N|
|000015e0| 65 77 50 61 72 6d 42 6c | 6b 2c 20 46 41 4c 53 45 |ewParmBl|k, FALSE|
|000015f0| 29 29 20 21 3d 20 6e 6f | 45 72 72 20 29 20 7b 0d |)) != no|Err ) {.|
|00001600| 09 09 4f 53 45 72 72 6f | 72 32 28 22 5c 70 4f 70 |..OSErro|r2("\pOp|
|00001610| 65 6e 53 46 57 72 69 74 | 65 20 45 72 72 6f 72 20 |enSFWrit|e Error |
|00001620| 6f 70 65 6e 69 6e 67 20 | 66 69 6c 65 3a 20 22 2c |opening |file: ",|
|00001630| 20 4e 65 77 53 6f 75 6e | 64 46 69 6c 65 4e 61 6d | NewSoun|dFileNam|
|00001640| 65 2c 20 74 68 65 45 72 | 72 29 3b 0d 09 09 72 65 |e, theEr|r);...re|
|00001650| 74 75 72 6e 28 46 41 4c | 53 45 29 3b 0d 09 7d 0d |turn(FAL|SE);..}.|
|00001660| 09 72 65 74 75 72 6e 28 | 54 52 55 45 29 3b 0d 7d |.return(|TRUE);.}|
|00001670| 0d 0d 0d 0d 0d 42 6f 6f | 6c 65 61 6e 09 4f 70 65 |.....Boo|lean.Ope|
|00001680| 6e 53 46 52 65 61 64 28 | 29 0d 7b 0d 09 72 65 67 |nSFRead(|).{..reg|
|00001690| 69 73 74 65 72 09 69 3b | 0d 09 53 46 54 79 70 65 |ister.i;|..SFType|
|000016a0| 4c 69 73 74 09 74 79 70 | 65 73 3b 0d 09 65 78 74 |List.typ|es;..ext|
|000016b0| 65 72 6e 09 09 69 6f 50 | 61 72 61 6d 09 09 6d 79 |ern..ioP|aram..my|
|000016c0| 49 4f 50 61 72 6d 42 6c | 6b 3b 0d 09 65 78 74 65 |IOParmBl|k;..exte|
|000016d0| 72 6e 09 09 53 74 72 32 | 35 35 09 09 53 6f 75 6e |rn..Str2|55..Soun|
|000016e0| 64 46 69 6c 65 4e 61 6d | 65 3b 0d 09 65 78 74 65 |dFileNam|e;..exte|
|000016f0| 72 6e 09 09 6c 6f 6e 67 | 09 09 09 66 69 6c 65 53 |rn..long|...fileS|
|00001700| 69 7a 65 3b 0d 09 65 78 | 74 65 72 6e 09 09 69 6e |ize;..ex|tern..in|
|00001710| 74 09 09 09 53 6f 75 6e | 64 46 69 6c 65 54 79 70 |t...Soun|dFileTyp|
|00001720| 65 3b 0d 09 65 78 74 65 | 72 6e 09 09 6c 6f 6e 67 |e;..exte|rn..long|
|00001730| 09 09 09 4e 75 6d 43 68 | 61 6e 6e 65 6c 73 3b 0d |...NumCh|annels;.|
|00001740| 09 65 78 74 65 72 6e 09 | 09 64 6f 75 62 6c 65 09 |.extern.|.double.|
|00001750| 09 4d 61 78 53 61 6d 70 | 6c 65 3b 0d 09 65 78 74 |.MaxSamp|le;..ext|
|00001760| 65 72 6e 09 09 64 6f 75 | 62 6c 65 09 09 4d 69 6e |ern..dou|ble..Min|
|00001770| 53 61 6d 70 6c 65 3b 0d | 09 65 78 74 65 72 6e 09 |Sample;.|.extern.|
|00001780| 09 6c 6f 6e 67 09 09 09 | 53 61 6d 70 6c 65 52 61 |.long...|SampleRa|
|00001790| 74 65 3b 0d 09 65 78 74 | 65 72 6e 09 09 42 6f 6f |te;..ext|ern..Boo|
|000017a0| 6c 65 61 6e 09 09 53 44 | 6e 6f 52 65 73 6f 75 72 |lean..SD|noResour|
|000017b0| 63 65 3b 0d 09 53 74 72 | 32 35 35 09 09 6d 79 53 |ce;..Str|255..myS|
|000017c0| 74 72 32 35 35 3b 0d 09 | 6c 6f 6e 67 09 09 09 73 |tr255;..|long...s|
|000017d0| 66 52 65 73 46 69 6c 65 | 52 65 66 4e 75 6d 3b 0d |fResFile|RefNum;.|
|000017e0| 09 53 74 72 32 35 35 09 | 09 72 65 73 53 74 72 69 |.Str255.|.resStri|
|000017f0| 6e 67 3b 0d 09 69 6e 74 | 09 77 64 52 65 66 4e 75 |ng;..int|.wdRefNu|
|00001800| 6d 3b 0d 09 0d 09 48 61 | 6e 64 6c 65 09 09 09 6d |m;....Ha|ndle...m|
|00001810| 79 48 6e 64 6c 3b 0d 09 | 53 74 72 69 6e 67 48 61 |yHndl;..|StringHa|
|00001820| 6e 64 6c 65 09 61 53 74 | 72 69 6e 67 3b 0d 09 53 |ndle.aSt|ring;..S|
|00001830| 74 72 32 35 35 09 09 09 | 6d 79 53 74 72 69 6e 67 |tr255...|myString|
|00001840| 3b 0d 09 0d 09 0d 09 69 | 66 20 28 20 53 46 44 69 |;......i|f ( SFDi|
|00001850| 72 65 63 74 6f 72 79 4e | 61 6d 65 5b 30 5d 20 21 |rectoryN|ame[0] !|
|00001860| 3d 20 4e 49 4c 20 29 20 | 7b 0d 09 09 69 66 20 28 |= NIL ) |{...if (|
|00001870| 20 21 53 65 74 53 46 44 | 69 72 28 53 46 44 69 72 | !SetSFD|ir(SFDir|
|00001880| 65 63 74 6f 72 79 4e 61 | 6d 65 2c 20 26 53 6f 75 |ectoryNa|me, &Sou|
|00001890| 6e 64 46 69 6c 65 44 69 | 72 49 44 29 20 29 20 7b |ndFileDi|rID) ) {|
|000018a0| 0d 09 09 09 43 75 72 44 | 69 72 53 74 6f 72 65 20 |....CurD|irStore |
|000018b0| 3d 20 53 74 61 72 74 55 | 70 44 69 72 49 44 3b 0d |= StartU|pDirID;.|
|000018c0| 09 09 09 72 65 74 75 72 | 6e 28 46 41 4c 53 45 29 |...retur|n(FALSE)|
|000018d0| 3b 0d 09 09 7d 0d 09 7d | 0d 09 74 79 70 65 73 5b |;...}..}|..types[|
|000018e0| 30 5d 20 3d 20 27 54 45 | 58 54 27 3b 0d 09 74 79 |0] = 'TE|XT';..ty|
|000018f0| 70 65 73 5b 31 5d 20 3d | 20 27 53 46 49 4c 27 3b |pes[1] =| 'SFIL';|
|00001900| 0d 09 74 79 70 65 73 5b | 32 5d 20 3d 20 27 53 64 |..types[|2] = 'Sd|
|00001910| 32 66 27 3b 0d 09 74 79 | 70 65 73 5b 33 5d 20 3d |2f';..ty|pes[3] =|
|00001920| 20 27 41 49 46 46 27 3b | 0d 09 53 65 74 50 74 28 | 'AIFF';|..SetPt(|
|00001930| 26 77 68 65 72 65 2c 20 | 31 30 30 2c 20 31 30 30 |&where, |100, 100|
|00001940| 29 3b 0d 09 53 46 47 65 | 74 46 69 6c 65 28 77 68 |);..SFGe|tFile(wh|
|00001950| 65 72 65 2c 20 4e 49 4c | 2c 20 4e 49 4c 2c 20 34 |ere, NIL|, NIL, 4|
|00001960| 2c 20 74 79 70 65 73 2c | 20 4e 49 4c 2c 20 26 53 |, types,| NIL, &S|
|00001970| 6f 75 6e 64 46 69 6c 65 | 52 65 70 6c 79 29 3b 0d |oundFile|Reply);.|
|00001980| 09 69 66 28 21 53 6f 75 | 6e 64 46 69 6c 65 52 65 |.if(!Sou|ndFileRe|
|00001990| 70 6c 79 2e 67 6f 6f 64 | 29 20 7b 0d 09 09 72 65 |ply.good|) {...re|
|000019a0| 74 75 72 6e 28 46 41 4c | 53 45 29 3b 0d 09 7d 0d |turn(FAL|SE);..}.|
|000019b0| 0d 09 47 65 74 53 46 44 | 69 72 28 53 46 44 69 72 |..GetSFD|ir(SFDir|
|000019c0| 65 63 74 6f 72 79 4e 61 | 6d 65 29 3b 0d 09 53 65 |ectoryNa|me);..Se|
|000019d0| 74 53 46 44 69 72 28 53 | 46 44 69 72 65 63 74 6f |tSFDir(S|FDirecto|
|000019e0| 72 79 4e 61 6d 65 2c 20 | 26 53 6f 75 6e 64 46 69 |ryName, |&SoundFi|
|000019f0| 6c 65 44 69 72 49 44 29 | 3b 0d 09 0d 09 50 73 74 |leDirID)|;....Pst|
|00001a00| 72 69 6e 67 43 6f 70 79 | 28 28 63 68 61 72 20 2a |ringCopy|((char *|
|00001a10| 29 53 6f 75 6e 64 46 69 | 6c 65 4e 61 6d 65 2c 20 |)SoundFi|leName, |
|00001a20| 28 63 68 61 72 20 2a 29 | 53 6f 75 6e 64 46 69 6c |(char *)|SoundFil|
|00001a30| 65 52 65 70 6c 79 2e 66 | 4e 61 6d 65 29 3b 0d 09 |eReply.f|Name);..|
|00001a40| 6d 79 49 4f 50 61 72 6d | 42 6c 6b 2e 69 6f 4e 61 |myIOParm|Blk.ioNa|
|00001a50| 6d 65 50 74 72 20 3d 20 | 28 53 74 72 69 6e 67 50 |mePtr = |(StringP|
|00001a60| 74 72 29 53 6f 75 6e 64 | 46 69 6c 65 52 65 70 6c |tr)Sound|FileRepl|
|00001a70| 79 2e 66 4e 61 6d 65 3b | 0d 09 6d 79 49 4f 50 61 |y.fName;|..myIOPa|
|00001a80| 72 6d 42 6c 6b 2e 69 6f | 56 52 65 66 4e 75 6d 20 |rmBlk.io|VRefNum |
|00001a90| 3d 20 53 6f 75 6e 64 46 | 69 6c 65 52 65 70 6c 79 |= SoundF|ileReply|
|00001aa0| 2e 76 52 65 66 4e 75 6d | 3b 0d 09 6d 79 49 4f 50 |.vRefNum|;..myIOP|
|00001ab0| 61 72 6d 42 6c 6b 2e 69 | 6f 56 65 72 73 4e 75 6d |armBlk.i|oVersNum|
|00001ac0| 20 3d 20 53 6f 75 6e 64 | 46 69 6c 65 52 65 70 6c | = Sound|FileRepl|
|00001ad0| 79 2e 76 65 72 73 69 6f | 6e 3b 0d 0d 09 6d 79 49 |y.versio|n;...myI|
|00001ae0| 4f 50 61 72 6d 42 6c 6b | 2e 69 6f 50 65 72 6d 73 |OParmBlk|.ioPerms|
|00001af0| 73 6e 20 3d 20 66 73 52 | 64 57 72 50 65 72 6d 3b |sn = fsR|dWrPerm;|
|00001b00| 0d 09 69 66 20 28 20 28 | 74 68 65 45 72 72 20 3d |..if ( (|theErr =|
|00001b10| 20 50 42 4f 70 65 6e 28 | 26 6d 79 49 4f 50 61 72 | PBOpen(|&myIOPar|
|00001b20| 6d 42 6c 6b 2c 20 46 41 | 4c 53 45 29 20 29 21 3d |mBlk, FA|LSE) )!=|
|00001b30| 20 6e 6f 45 72 72 29 20 | 7b 0d 09 09 4f 53 45 72 | noErr) |{...OSEr|
|00001b40| 72 6f 72 28 22 5c 70 45 | 72 72 6f 72 20 6f 70 65 |ror("\pE|rror ope|
|00001b50| 6e 69 6e 67 20 66 69 6c | 65 22 2c 20 4e 49 4c 29 |ning fil|e", NIL)|
|00001b60| 3b 0d 09 7d 0d 09 6d 79 | 49 4f 50 61 72 6d 42 6c |;..}..my|IOParmBl|
|00001b70| 6b 2e 69 6f 43 6f 6d 70 | 6c 65 74 69 6f 6e 20 3d |k.ioComp|letion =|
|00001b80| 20 4e 49 4c 3b 0d 09 50 | 42 47 65 74 45 4f 46 28 | NIL;..P|BGetEOF(|
|00001b90| 26 6d 79 49 4f 50 61 72 | 6d 42 6c 6b 2c 20 46 41 |&myIOPar|mBlk, FA|
|00001ba0| 4c 53 45 29 3b 0d 09 69 | 66 20 28 20 28 66 69 6c |LSE);..i|f ( (fil|
|00001bb0| 65 53 69 7a 65 20 3d 20 | 28 6c 6f 6e 67 29 6d 79 |eSize = |(long)my|
|00001bc0| 49 4f 50 61 72 6d 42 6c | 6b 2e 69 6f 4d 69 73 63 |IOParmBl|k.ioMisc|
|00001bd0| 29 20 3c 3d 20 30 20 29 | 20 7b 0d 09 09 4f 53 45 |) <= 0 )| {...OSE|
|00001be0| 72 72 6f 72 28 22 5c 70 | 66 69 6c 65 20 69 73 20 |rror("\p|file is |
|00001bf0| 65 6d 70 74 79 21 22 2c | 20 4e 49 4c 29 3b 0d 09 |empty!",| NIL);..|
|00001c00| 09 72 65 74 75 72 6e 28 | 46 41 4c 53 45 29 3b 0d |.return(|FALSE);.|
|00001c10| 09 7d 0d 09 0d 09 0d 09 | 2f 2a 20 6e 6f 77 20 72 |.}......|/* now r|
|00001c20| 65 61 64 20 74 68 65 20 | 72 65 73 6f 75 72 63 65 |ead the |resource|
|00001c30| 20 70 61 72 74 20 2a 2f | 0d 09 2f 2a 20 66 69 72 | part */|../* fir|
|00001c40| 73 74 20 63 68 65 63 6b | 20 69 66 20 69 74 20 69 |st check| if it i|
|00001c50| 73 20 61 20 53 6f 75 6e | 64 20 44 65 73 69 67 6e |s a Soun|d Design|
|00001c60| 65 72 20 66 69 6c 65 20 | 2a 2f 0d 09 66 50 42 2e |er file |*/..fPB.|
|00001c70| 69 6f 43 6f 6d 70 6c 65 | 74 69 6f 6e 20 3d 20 28 |ioComple|tion = (|
|00001c80| 50 72 6f 63 50 74 72 29 | 4e 49 4c 3b 0d 09 66 50 |ProcPtr)|NIL;..fP|
|00001c90| 42 2e 69 6f 4e 61 6d 65 | 50 74 72 20 3d 20 6d 79 |B.ioName|Ptr = my|
|00001ca0| 49 4f 50 61 72 6d 42 6c | 6b 2e 69 6f 4e 61 6d 65 |IOParmBl|k.ioName|
|00001cb0| 50 74 72 3b 0d 09 66 50 | 42 2e 69 6f 56 52 65 66 |Ptr;..fP|B.ioVRef|
|00001cc0| 4e 75 6d 20 3d 20 6d 79 | 49 4f 50 61 72 6d 42 6c |Num = my|IOParmBl|
|00001cd0| 6b 2e 69 6f 56 52 65 66 | 4e 75 6d 3b 0d 09 66 50 |k.ioVRef|Num;..fP|
|00001ce0| 42 2e 69 6f 46 56 65 72 | 73 4e 75 6d 20 3d 20 6d |B.ioFVer|sNum = m|
|00001cf0| 79 49 4f 50 61 72 6d 42 | 6c 6b 2e 69 6f 56 65 72 |yIOParmB|lk.ioVer|
|00001d00| 73 4e 75 6d 3b 0d 09 66 | 50 42 2e 69 6f 46 44 69 |sNum;..f|PB.ioFDi|
|00001d10| 72 49 6e 64 65 78 20 3d | 20 4e 49 4c 3b 0d 09 74 |rIndex =| NIL;..t|
|00001d20| 68 65 45 72 72 20 3d 20 | 50 42 47 65 74 46 49 6e |heErr = |PBGetFIn|
|00001d30| 66 6f 28 26 66 50 42 2c | 20 46 41 4c 53 45 29 3b |fo(&fPB,| FALSE);|
|00001d40| 0d 09 69 66 20 28 20 28 | 66 50 42 2e 69 6f 46 6c |..if ( (|fPB.ioFl|
|00001d50| 46 6e 64 72 49 6e 66 6f | 2e 66 64 54 79 70 65 20 |FndrInfo|.fdType |
|00001d60| 3d 3d 20 27 54 45 58 54 | 27 29 20 26 26 0d 09 09 |== 'TEXT|') &&...|
|00001d70| 09 28 28 66 50 42 2e 69 | 6f 46 6c 46 6e 64 72 49 |.((fPB.i|oFlFndrI|
|00001d80| 6e 66 6f 2e 66 64 43 72 | 65 61 74 6f 72 20 3d 3d |nfo.fdCr|eator ==|
|00001d90| 20 27 4d 55 34 43 27 29 | 20 7c 7c 20 28 66 50 42 | 'MU4C')| || (fPB|
|00001da0| 2e 69 6f 46 6c 46 6e 64 | 72 49 6e 66 6f 2e 66 64 |.ioFlFnd|rInfo.fd|
|00001db0| 43 72 65 61 74 6f 72 20 | 3d 3d 20 27 53 46 49 4e |Creator |== 'SFIN|
|00001dc0| 27 29 29 29 0d 09 09 53 | 6f 75 6e 64 46 69 6c 65 |')))...S|oundFile|
|00001dd0| 54 79 70 65 20 3d 20 46 | 4c 4f 41 54 3b 0d 09 69 |Type = F|LOAT;..i|
|00001de0| 66 20 28 20 66 50 42 2e | 69 6f 46 6c 46 6e 64 72 |f ( fPB.|ioFlFndr|
|00001df0| 49 6e 66 6f 2e 66 64 54 | 79 70 65 20 3d 3d 20 27 |Info.fdT|ype == '|
|00001e00| 53 46 49 4c 27 20 29 0d | 09 09 53 6f 75 6e 64 46 |SFIL' ).|..SoundF|
|00001e10| 69 6c 65 54 79 70 65 20 | 3d 20 53 44 31 3b 0d 09 |ileType |= SD1;..|
|00001e20| 65 6c 73 65 20 69 66 20 | 28 20 66 50 42 2e 69 6f |else if |( fPB.io|
|00001e30| 46 6c 46 6e 64 72 49 6e | 66 6f 2e 66 64 54 79 70 |FlFndrIn|fo.fdTyp|
|00001e40| 65 20 3d 3d 20 27 53 64 | 32 66 27 20 29 0d 09 09 |e == 'Sd|2f' )...|
|00001e50| 53 6f 75 6e 64 46 69 6c | 65 54 79 70 65 20 3d 20 |SoundFil|eType = |
|00001e60| 53 44 32 3b 0d 09 65 6c | 73 65 20 69 66 20 28 20 |SD2;..el|se if ( |
|00001e70| 66 50 42 2e 69 6f 46 6c | 46 6e 64 72 49 6e 66 6f |fPB.ioFl|FndrInfo|
|00001e80| 2e 66 64 54 79 70 65 20 | 3d 3d 20 27 41 49 46 46 |.fdType |== 'AIFF|
|00001e90| 27 20 29 20 7b 0d 09 09 | 53 6f 75 6e 64 46 69 6c |' ) {...|SoundFil|
|00001ea0| 65 54 79 70 65 20 3d 20 | 41 49 46 46 3b 0d 09 09 |eType = |AIFF;...|
|00001eb0| 72 65 74 75 72 6e 28 54 | 52 55 45 29 3b 0d 09 7d |return(T|RUE);..}|
|00001ec0| 0d 0d 2f 2a 20 77 65 20 | 6b 6e 6f 77 20 74 68 65 |../* we |know the|
|00001ed0| 20 74 79 70 65 20 6f 66 | 20 66 69 6c 65 2c 20 6f | type of| file, o|
|00001ee0| 70 65 6e 20 74 68 65 20 | 72 65 73 6f 75 72 63 65 |pen the |resource|
|00001ef0| 20 66 6f 72 6b 20 2a 2f | 0d 0d 09 73 66 52 65 73 | fork */|...sfRes|
|00001f00| 46 69 6c 65 52 65 66 4e | 75 6d 20 3d 20 4f 70 65 |FileRefN|um = Ope|
|00001f10| 6e 52 65 73 46 69 6c 65 | 28 53 6f 75 6e 64 46 69 |nResFile|(SoundFi|
|00001f20| 6c 65 4e 61 6d 65 29 3b | 0d 09 53 44 6e 6f 52 65 |leName);|..SDnoRe|
|00001f30| 73 6f 75 72 63 65 20 3d | 20 46 41 4c 53 45 3b 0d |source =| FALSE;.|
|00001f40| 09 69 66 20 28 28 74 68 | 65 45 72 72 20 3d 20 52 |.if ((th|eErr = R|
|00001f50| 65 73 45 72 72 6f 72 28 | 29 29 20 21 3d 20 6e 6f |esError(|)) != no|
|00001f60| 45 72 72 29 20 7b 0d 09 | 09 2f 2a 20 6e 6f 20 72 |Err) {..|./* no r|
|00001f70| 65 73 6f 75 72 63 65 20 | 66 6f 72 6b 2c 20 6e 6f |esource |fork, no|
|00001f80| 74 20 61 20 46 4c 4f 41 | 54 20 6f 72 20 53 44 32 |t a FLOA|T or SD2|
|00001f90| 20 66 69 6c 65 2c 20 63 | 6f 75 6c 64 20 62 65 20 | file, c|ould be |
|00001fa0| 53 44 31 20 6f 72 20 41 | 49 46 46 20 2a 2f 0d 09 |SD1 or A|IFF */..|
|00001fb0| 09 69 66 20 28 20 53 6f | 75 6e 64 46 69 6c 65 54 |.if ( So|undFileT|
|00001fc0| 79 70 65 20 21 3d 20 53 | 44 31 20 26 26 20 53 6f |ype != S|D1 && So|
|00001fd0| 75 6e 64 46 69 6c 65 54 | 79 70 65 20 21 3d 20 41 |undFileT|ype != A|
|00001fe0| 49 46 46 29 20 7b 0d 09 | 09 09 4f 53 45 72 72 6f |IFF) {..|..OSErro|
|00001ff0| 72 32 28 22 5c 70 45 72 | 72 6f 72 20 6f 70 65 6e |r2("\pEr|ror open|
|00002000| 69 6e 67 20 72 65 73 6f | 75 72 63 65 20 66 69 6c |ing reso|urce fil|
|00002010| 65 3a 20 22 2c 20 53 6f | 75 6e 64 46 69 6c 65 4e |e: ", So|undFileN|
|00002020| 61 6d 65 2c 20 74 68 65 | 45 72 72 29 3b 0d 09 09 |ame, the|Err);...|
|00002030| 09 72 65 74 75 72 6e 28 | 46 41 4c 53 45 29 3b 0d |.return(|FALSE);.|
|00002040| 09 09 7d 0d 09 09 65 6c | 73 65 20 7b 0d 09 09 09 |..}...el|se {....|
|00002050| 53 44 6e 6f 52 65 73 6f | 75 72 63 65 20 3d 20 54 |SDnoReso|urce = T|
|00002060| 52 55 45 3b 0d 09 09 7d | 0d 09 09 72 65 74 75 72 |RUE;...}|...retur|
|00002070| 6e 28 54 52 55 45 29 3b | 0d 09 7d 0d 09 0d 09 0d |n(TRUE);|..}.....|
|00002080| 09 47 65 74 49 6e 64 53 | 74 72 69 6e 67 28 26 72 |.GetIndS|tring(&r|
|00002090| 65 73 53 74 72 69 6e 67 | 2c 20 53 46 52 45 53 4f |esString|, SFRESO|
|000020a0| 55 52 43 45 4e 55 4d 2c | 20 31 29 3b 0d 09 50 74 |URCENUM,| 1);..Pt|
|000020b0| 6f 43 73 74 72 28 28 63 | 68 61 72 20 2a 29 72 65 |oCstr((c|har *)re|
|000020c0| 73 53 74 72 69 6e 67 29 | 3b 0d 09 69 66 20 28 20 |sString)|;..if ( |
|000020d0| 73 74 72 63 6d 70 28 22 | 22 2c 20 28 63 68 61 72 |strcmp("|", (char|
|000020e0| 20 2a 29 72 65 73 53 74 | 72 69 6e 67 29 20 3d 3d | *)resSt|ring) ==|
|000020f0| 20 30 20 29 20 7b 0d 2f | 2a 20 69 2e 65 2e 20 68 | 0 ) {./|* i.e. h|
|00002100| 61 76 65 20 61 20 72 65 | 73 6f 75 72 63 65 20 66 |ave a re|source f|
|00002110| 6f 72 6b 20 62 75 74 20 | 6e 6f 74 20 61 20 73 6f |ork but |not a so|
|00002120| 75 6e 64 66 69 6c 65 20 | 72 65 73 6f 75 72 63 65 |undfile |resource|
|00002130| 2e 20 43 68 65 63 6b 20 | 66 6f 72 20 61 20 53 44 |. Check |for a SD|
|00002140| 32 20 72 65 73 6f 75 72 | 63 65 20 2a 2f 0d 09 09 |2 resour|ce */...|
|00002150| 6d 79 48 6e 64 6c 20 3d | 20 47 65 74 52 65 73 6f |myHndl =| GetReso|
|00002160| 75 72 63 65 28 27 53 54 | 52 20 27 2c 20 53 41 4d |urce('ST|R ', SAM|
|00002170| 50 4c 45 5f 52 41 54 45 | 5f 52 45 53 20 29 3b 0d |PLE_RATE|_RES );.|
|00002180| 09 09 69 66 20 28 20 6d | 79 48 6e 64 6c 20 26 26 |..if ( m|yHndl &&|
|00002190| 20 28 74 68 65 45 72 72 | 20 3d 20 52 65 73 45 72 | (theErr| = ResEr|
|000021a0| 72 6f 72 28 29 29 20 3d | 3d 20 6e 6f 45 72 72 29 |ror()) =|= noErr)|
|000021b0| 20 7b 0d 09 09 09 61 53 | 74 72 69 6e 67 20 3d 20 | {....aS|tring = |
|000021c0| 28 53 74 72 69 6e 67 48 | 61 6e 64 6c 65 29 47 65 |(StringH|andle)Ge|
|000021d0| 74 53 74 72 69 6e 67 28 | 53 41 4d 50 4c 45 5f 52 |tString(|SAMPLE_R|
|000021e0| 41 54 45 5f 52 45 53 29 | 3b 0d 09 09 09 48 4c 6f |ATE_RES)|;....HLo|
|000021f0| 63 6b 28 61 53 74 72 69 | 6e 67 29 3b 0d 09 09 09 |ck(aStri|ng);....|
|00002200| 50 73 74 72 69 6e 67 43 | 6f 70 79 28 28 63 68 61 |PstringC|opy((cha|
|00002210| 72 20 2a 29 6d 79 53 74 | 72 69 6e 67 2c 20 28 63 |r *)mySt|ring, (c|
|00002220| 68 61 72 20 2a 29 2a 61 | 53 74 72 69 6e 67 29 3b |har *)*a|String);|
|00002230| 0d 09 09 09 50 74 6f 43 | 73 74 72 28 28 63 68 61 |....PtoC|str((cha|
|00002240| 72 20 2a 29 6d 79 53 74 | 72 69 6e 67 29 3b 0d 09 |r *)mySt|ring);..|
|00002250| 09 09 2f 2a 20 22 63 61 | 73 74 22 20 74 6f 20 69 |../* "ca|st" to i|
|00002260| 6e 74 65 67 65 72 20 76 | 61 6c 75 65 20 2a 2f 0d |nteger v|alue */.|
|00002270| 09 09 09 69 20 3d 20 73 | 74 72 63 73 70 6e 28 28 |...i = s|trcspn((|
|00002280| 63 68 61 72 20 2a 29 6d | 79 53 74 72 69 6e 67 2c |char *)m|yString,|
|00002290| 20 22 2e 22 29 3b 0d 09 | 09 09 69 66 20 28 20 69 | ".");..|..if ( i|
|000022a0| 20 3e 20 30 20 29 0d 09 | 09 09 09 6d 79 53 74 72 | > 0 )..|...myStr|
|000022b0| 69 6e 67 5b 69 5d 20 3d | 20 27 5c 30 27 3b 0d 09 |ing[i] =| '\0';..|
|000022c0| 09 09 43 74 6f 50 73 74 | 72 28 28 63 68 61 72 20 |..CtoPst|r((char |
|000022d0| 2a 29 6d 79 53 74 72 69 | 6e 67 29 3b 0d 09 09 09 |*)myStri|ng);....|
|000022e0| 53 74 72 69 6e 67 54 6f | 4e 75 6d 28 6d 79 53 74 |StringTo|Num(mySt|
|000022f0| 72 69 6e 67 2c 20 26 53 | 61 6d 70 6c 65 52 61 74 |ring, &S|ampleRat|
|00002300| 65 29 3b 0d 09 09 09 48 | 55 6e 6c 6f 63 6b 28 61 |e);....H|Unlock(a|
|00002310| 53 74 72 69 6e 67 29 3b | 0d 09 09 09 44 69 73 70 |String);|....Disp|
|00002320| 6f 73 48 61 6e 64 6c 65 | 28 61 53 74 72 69 6e 67 |osHandle|(aString|
|00002330| 29 3b 0d 09 09 09 53 6f | 75 6e 64 46 69 6c 65 54 |);....So|undFileT|
|00002340| 79 70 65 20 3d 20 53 44 | 32 3b 0d 09 09 09 6d 79 |ype = SD|2;....my|
|00002350| 48 6e 64 6c 20 3d 20 47 | 65 74 52 65 73 6f 75 72 |Hndl = G|etResour|
|00002360| 63 65 28 27 53 54 52 20 | 27 2c 20 53 41 4d 50 4c |ce('STR |', SAMPL|
|00002370| 45 5f 43 48 41 4e 4e 45 | 4c 53 5f 52 45 53 20 29 |E_CHANNE|LS_RES )|
|00002380| 3b 0d 09 09 09 69 66 20 | 28 28 74 68 65 45 72 72 |;....if |((theErr|
|00002390| 20 3d 20 52 65 73 45 72 | 72 6f 72 28 29 29 20 3d | = ResEr|ror()) =|
|000023a0| 3d 20 6e 6f 45 72 72 29 | 20 7b 0d 09 09 09 09 61 |= noErr)| {.....a|
|000023b0| 53 74 72 69 6e 67 20 3d | 20 28 53 74 72 69 6e 67 |String =| (String|
|000023c0| 48 61 6e 64 6c 65 29 47 | 65 74 53 74 72 69 6e 67 |Handle)G|etString|
|000023d0| 28 53 41 4d 50 4c 45 5f | 43 48 41 4e 4e 45 4c 53 |(SAMPLE_|CHANNELS|
|000023e0| 5f 52 45 53 29 3b 0d 09 | 09 09 09 48 4c 6f 63 6b |_RES);..|...HLock|
|000023f0| 28 61 53 74 72 69 6e 67 | 29 3b 0d 09 09 09 09 53 |(aString|);.....S|
|00002400| 74 72 69 6e 67 54 6f 4e | 75 6d 28 2a 61 53 74 72 |tringToN|um(*aStr|
|00002410| 69 6e 67 2c 20 26 4e 75 | 6d 43 68 61 6e 6e 65 6c |ing, &Nu|mChannel|
|00002420| 73 29 3b 0d 09 09 09 09 | 48 55 6e 6c 6f 63 6b 28 |s);.....|HUnlock(|
|00002430| 61 53 74 72 69 6e 67 29 | 3b 0d 09 09 09 7d 0d 09 |aString)|;....}..|
|00002440| 09 09 44 69 73 70 6f 73 | 48 61 6e 64 6c 65 28 61 |..Dispos|Handle(a|
|00002450| 53 74 72 69 6e 67 29 3b | 0d 09 09 09 44 69 73 70 |String);|....Disp|
|00002460| 6f 73 48 61 6e 64 6c 65 | 28 6d 79 48 6e 64 6c 29 |osHandle|(myHndl)|
|00002470| 3b 0d 09 09 7d 0d 09 09 | 65 6c 73 65 20 7b 0d 09 |;...}...|else {..|
|00002480| 09 2f 2a 20 6e 6f 74 20 | 61 20 53 46 20 72 65 73 |./* not |a SF res|
|00002490| 6f 75 72 63 65 20 61 6e | 64 20 6e 6f 74 20 61 20 |ource an|d not a |
|000024a0| 53 44 32 20 72 65 73 6f | 75 72 63 65 2c 20 63 6f |SD2 reso|urce, co|
|000024b0| 75 6c 64 20 62 65 20 61 | 6e 20 41 6c 63 68 65 6d |uld be a|n Alchem|
|000024c0| 79 20 41 49 46 46 20 66 | 69 6c 65 20 77 69 74 68 |y AIFF f|ile with|
|000024d0| 20 72 65 73 6f 75 72 63 | 65 73 20 2a 2f 0d 09 09 | resourc|es */...|
|000024e0| 09 69 66 20 28 53 6f 75 | 6e 64 46 69 6c 65 54 79 |.if (Sou|ndFileTy|
|000024f0| 70 65 20 21 3d 20 41 49 | 46 46 29 20 7b 0d 09 09 |pe != AI|FF) {...|
|00002500| 09 09 53 44 6e 6f 52 65 | 73 6f 75 72 63 65 20 3d |..SDnoRe|source =|
|00002510| 20 54 52 55 45 3b 0d 09 | 09 09 09 72 65 74 75 72 | TRUE;..|...retur|
|00002520| 6e 28 54 52 55 45 29 3b | 0d 09 09 09 7d 0d 09 09 |n(TRUE);|....}...|
|00002530| 09 65 6c 73 65 20 7b 0d | 09 09 09 09 43 74 6f 50 |.else {.|....CtoP|
|00002540| 73 74 72 28 28 63 68 61 | 72 20 2a 29 72 65 73 53 |str((cha|r *)resS|
|00002550| 74 72 69 6e 67 29 3b 0d | 09 09 09 09 4f 53 45 72 |tring);.|....OSEr|
|00002560| 72 6f 72 32 28 22 5c 70 | 55 6e 6b 6e 6f 77 6e 20 |ror2("\p|Unknown |
|00002570| 53 6f 75 6e 64 20 66 69 | 6c 65 20 74 79 70 65 22 |Sound fi|le type"|
|00002580| 2c 20 72 65 73 53 74 72 | 69 6e 67 2c 20 4e 49 4c |, resStr|ing, NIL|
|00002590| 29 3b 0d 09 09 09 09 72 | 65 74 75 72 6e 28 46 41 |);.....r|eturn(FA|
|000025a0| 4c 53 45 29 3b 0d 09 09 | 09 7d 0d 09 09 7d 0d 09 |LSE);...|.}...}..|
|000025b0| 7d 0d 2f 2a 20 77 65 20 | 6d 61 79 20 68 61 76 65 |}./* we |may have|
|000025c0| 20 61 20 53 46 20 72 65 | 73 6f 75 72 63 65 2c 20 | a SF re|source, |
|000025d0| 61 73 20 77 65 6c 6c 20 | 61 73 20 6f 74 68 65 72 |as well |as other|
|000025e0| 20 72 65 73 6f 75 72 63 | 65 73 20 2a 2f 0d 09 69 | resourc|es */..i|
|000025f0| 66 20 28 20 73 74 72 63 | 6d 70 28 22 46 4c 4f 41 |f ( strc|mp("FLOA|
|00002600| 54 22 2c 20 28 63 68 61 | 72 20 2a 29 72 65 73 53 |T", (cha|r *)resS|
|00002610| 74 72 69 6e 67 29 20 3d | 3d 20 30 20 29 20 7b 0d |tring) =|= 0 ) {.|
|00002620| 09 09 53 6f 75 6e 64 46 | 69 6c 65 54 79 70 65 20 |..SoundF|ileType |
|00002630| 3d 20 46 4c 4f 41 54 3b | 0d 09 7d 0d 09 65 6c 73 |= FLOAT;|..}..els|
|00002640| 65 20 69 66 20 28 20 73 | 74 72 63 6d 70 28 22 49 |e if ( s|trcmp("I|
|00002650| 4e 54 31 36 22 2c 20 28 | 63 68 61 72 20 2a 29 72 |NT16", (|char *)r|
|00002660| 65 73 53 74 72 69 6e 67 | 29 20 3d 3d 20 30 20 29 |esString|) == 0 )|
|00002670| 20 7b 0d 09 09 53 6f 75 | 6e 64 46 69 6c 65 54 79 | {...Sou|ndFileTy|
|00002680| 70 65 20 3d 20 49 4e 54 | 31 36 3b 0d 09 7d 0d 09 |pe = INT|16;..}..|
|00002690| 65 6c 73 65 20 69 66 20 | 28 20 73 74 72 63 6d 70 |else if |( strcmp|
|000026a0| 28 22 53 44 22 2c 20 28 | 63 68 61 72 20 2a 29 72 |("SD", (|char *)r|
|000026b0| 65 73 53 74 72 69 6e 67 | 29 20 3d 3d 20 30 20 29 |esString|) == 0 )|
|000026c0| 20 7b 0d 09 09 53 6f 75 | 6e 64 46 69 6c 65 54 79 | {...Sou|ndFileTy|
|000026d0| 70 65 20 3d 20 53 44 31 | 3b 0d 09 7d 0d 09 65 6c |pe = SD1|;..}..el|
|000026e0| 73 65 20 69 66 20 28 20 | 73 74 72 63 6d 70 28 22 |se if ( |strcmp("|
|000026f0| 53 44 31 22 2c 20 28 63 | 68 61 72 20 2a 29 72 65 |SD1", (c|har *)re|
|00002700| 73 53 74 72 69 6e 67 29 | 20 3d 3d 20 30 20 29 20 |sString)| == 0 ) |
|00002710| 7b 0d 09 09 53 6f 75 6e | 64 46 69 6c 65 54 79 70 |{...Soun|dFileTyp|
|00002720| 65 20 3d 20 53 44 31 3b | 0d 09 7d 0d 09 65 6c 73 |e = SD1;|..}..els|
|00002730| 65 20 69 66 20 28 20 73 | 74 72 63 6d 70 28 22 53 |e if ( s|trcmp("S|
|00002740| 44 32 22 2c 20 28 63 68 | 61 72 20 2a 29 72 65 73 |D2", (ch|ar *)res|
|00002750| 53 74 72 69 6e 67 29 20 | 3d 3d 20 30 20 29 20 7b |String) |== 0 ) {|
|00002760| 0d 09 09 53 6f 75 6e 64 | 46 69 6c 65 54 79 70 65 |...Sound|FileType|
|00002770| 20 3d 20 53 44 32 3b 0d | 09 7d 0d 09 65 6c 73 65 | = SD2;.|.}..else|
|00002780| 20 69 66 20 28 20 73 74 | 72 63 6d 70 28 22 41 49 | if ( st|rcmp("AI|
|00002790| 46 46 22 2c 20 28 63 68 | 61 72 20 2a 29 72 65 73 |FF", (ch|ar *)res|
|000027a0| 53 74 72 69 6e 67 29 20 | 3d 3d 20 30 20 29 20 7b |String) |== 0 ) {|
|000027b0| 0d 09 09 53 6f 75 6e 64 | 46 69 6c 65 54 79 70 65 |...Sound|FileType|
|000027c0| 20 3d 20 41 49 46 46 3b | 0d 09 7d 0d 0d 09 47 65 | = AIFF;|..}...Ge|
|000027d0| 74 49 6e 64 53 74 72 69 | 6e 67 28 26 72 65 73 53 |tIndStri|ng(&resS|
|000027e0| 74 72 69 6e 67 2c 20 53 | 46 52 45 53 4f 55 52 43 |tring, S|FRESOURC|
|000027f0| 45 4e 55 4d 2c 20 32 29 | 3b 0d 09 69 66 20 28 20 |ENUM, 2)|;..if ( |
|00002800| 72 65 73 53 74 72 69 6e | 67 5b 30 5d 20 3e 20 30 |resStrin|g[0] > 0|
|00002810| 20 29 20 7b 0d 09 09 53 | 74 72 69 6e 67 54 6f 4e | ) {...S|tringToN|
|00002820| 75 6d 28 72 65 73 53 74 | 72 69 6e 67 2c 20 26 4e |um(resSt|ring, &N|
|00002830| 75 6d 43 68 61 6e 6e 65 | 6c 73 29 3b 0d 09 09 69 |umChanne|ls);...i|
|00002840| 66 20 28 20 4e 75 6d 43 | 68 61 6e 6e 65 6c 73 20 |f ( NumC|hannels |
|00002850| 3e 20 34 4c 29 20 7b 0d | 09 09 09 4f 53 45 72 72 |> 4L) {.|...OSErr|
|00002860| 6f 72 28 22 5c 70 6d 6f | 6e 6f 2c 20 73 74 65 72 |or("\pmo|no, ster|
|00002870| 65 6f 20 6f 72 20 71 75 | 61 64 20 73 6f 75 6e 64 |eo or qu|ad sound|
|00002880| 66 69 6c 65 73 22 2c 20 | 4e 49 4c 29 3b 0d 09 09 |files", |NIL);...|
|00002890| 09 72 65 74 75 72 6e 28 | 46 41 4c 53 45 29 3b 0d |.return(|FALSE);.|
|000028a0| 09 09 7d 0d 09 09 69 66 | 20 28 20 4e 75 6d 43 68 |..}...if| ( NumCh|
|000028b0| 61 6e 6e 65 6c 73 20 3c | 20 31 20 29 20 7b 0d 09 |annels <| 1 ) {..|
|000028c0| 2f 2a 09 09 09 4f 53 45 | 72 72 6f 72 32 28 22 5c |/*...OSE|rror2("\|
|000028d0| 70 4e 75 6d 62 65 72 20 | 6f 66 20 63 68 61 6e 6e |pNumber |of chann|
|000028e0| 65 6c 73 20 3d 20 30 20 | 3f 22 2c 20 22 6d 6f 6e |els = 0 |?", "mon|
|000028f0| 6f 20 61 73 73 75 6d 65 | 64 22 2c 20 4e 49 4c 29 |o assume|d", NIL)|
|00002900| 3b 2a 2f 0d 09 09 09 4e | 75 6d 43 68 61 6e 6e 65 |;*/....N|umChanne|
|00002910| 6c 73 20 3d 20 31 3b 0d | 09 09 7d 0d 09 7d 0d 0d |ls = 1;.|..}..}..|
|00002920| 09 47 65 74 49 6e 64 53 | 74 72 69 6e 67 28 26 72 |.GetIndS|tring(&r|
|00002930| 65 73 53 74 72 69 6e 67 | 2c 20 53 46 52 45 53 4f |esString|, SFRESO|
|00002940| 55 52 43 45 4e 55 4d 2c | 20 33 29 3b 0d 09 69 66 |URCENUM,| 3);..if|
|00002950| 20 28 20 72 65 73 53 74 | 72 69 6e 67 5b 30 5d 20 | ( resSt|ring[0] |
|00002960| 3e 20 30 20 29 20 7b 0d | 09 09 53 74 72 69 6e 67 |> 0 ) {.|..String|
|00002970| 54 6f 4e 75 6d 28 72 65 | 73 53 74 72 69 6e 67 2c |ToNum(re|sString,|
|00002980| 20 26 53 61 6d 70 6c 65 | 52 61 74 65 29 3b 0d 09 | &Sample|Rate);..|
|00002990| 7d 0d 09 47 65 74 49 6e | 64 53 74 72 69 6e 67 28 |}..GetIn|dString(|
|000029a0| 26 72 65 73 53 74 72 69 | 6e 67 2c 20 53 46 52 45 |&resStri|ng, SFRE|
|000029b0| 53 4f 55 52 43 45 4e 55 | 4d 2c 20 34 29 3b 0d 09 |SOURCENU|M, 4);..|
|000029c0| 69 66 20 28 20 72 65 73 | 53 74 72 69 6e 67 5b 30 |if ( res|String[0|
|000029d0| 5d 20 3e 20 30 20 29 20 | 7b 0d 09 09 50 74 6f 43 |] > 0 ) |{...PtoC|
|000029e0| 73 74 72 28 28 63 68 61 | 72 20 2a 29 72 65 73 53 |str((cha|r *)resS|
|000029f0| 74 72 69 6e 67 29 3b 0d | 09 09 73 73 63 61 6e 66 |tring);.|..sscanf|
|00002a00| 28 28 63 68 61 72 20 2a | 29 72 65 73 53 74 72 69 |((char *|)resStri|
|00002a10| 6e 67 2c 20 22 25 6c 66 | 22 2c 20 26 4d 61 78 53 |ng, "%lf|", &MaxS|
|00002a20| 61 6d 70 6c 65 29 3b 0d | 09 7d 0d 09 47 65 74 49 |ample);.|.}..GetI|
|00002a30| 6e 64 53 74 72 69 6e 67 | 28 26 72 65 73 53 74 72 |ndString|(&resStr|
|00002a40| 69 6e 67 2c 20 53 46 52 | 45 53 4f 55 52 43 45 4e |ing, SFR|ESOURCEN|
|00002a50| 55 4d 2c 20 35 29 3b 0d | 09 69 66 20 28 20 72 65 |UM, 5);.|.if ( re|
|00002a60| 73 53 74 72 69 6e 67 5b | 30 5d 20 3e 20 30 20 29 |sString[|0] > 0 )|
|00002a70| 20 7b 0d 09 09 50 74 6f | 43 73 74 72 28 28 63 68 | {...Pto|Cstr((ch|
|00002a80| 61 72 20 2a 29 72 65 73 | 53 74 72 69 6e 67 29 3b |ar *)res|String);|
|00002a90| 0d 09 09 73 73 63 61 6e | 66 28 28 63 68 61 72 20 |...sscan|f((char |
|00002aa0| 2a 29 72 65 73 53 74 72 | 69 6e 67 2c 20 22 25 6c |*)resStr|ing, "%l|
|00002ab0| 66 22 2c 20 26 4d 69 6e | 53 61 6d 70 6c 65 29 3b |f", &Min|Sample);|
|00002ac0| 0d 09 7d 0d 09 43 6c 6f | 73 65 52 65 73 46 69 6c |..}..Clo|seResFil|
|00002ad0| 65 28 73 66 52 65 73 46 | 69 6c 65 52 65 66 4e 75 |e(sfResF|ileRefNu|
|00002ae0| 6d 29 3b 0d 0d 09 72 65 | 74 75 72 6e 28 54 52 55 |m);...re|turn(TRU|
|00002af0| 45 29 3b 0d 7d 0d 0d 0d | 0d 42 6f 6f 6c 65 61 6e |E);.}...|.Boolean|
|00002b00| 09 43 6c 6f 73 65 53 46 | 28 29 0d 7b 0d 09 65 78 |.CloseSF|().{..ex|
|00002b10| 74 65 72 6e 09 09 69 6f | 50 61 72 61 6d 09 09 6d |tern..io|Param..m|
|00002b20| 79 49 4f 50 61 72 6d 42 | 6c 6b 3b 0d 09 65 78 74 |yIOParmB|lk;..ext|
|00002b30| 65 72 6e 09 09 69 6f 50 | 61 72 61 6d 09 09 4e 65 |ern..ioP|aram..Ne|
|00002b40| 77 50 61 72 6d 42 6c 6b | 3b 0d 09 65 78 74 65 72 |wParmBlk|;..exter|
|00002b50| 6e 09 69 6e 74 09 49 46 | 69 6c 65 4f 70 65 6e 2c |n.int.IF|ileOpen,|
|00002b60| 20 4f 46 69 6c 65 4f 70 | 65 6e 3b 0d 09 0d 09 69 | OFileOp|en;....i|
|00002b70| 66 20 28 20 49 46 69 6c | 65 4f 70 65 6e 20 29 20 |f ( IFil|eOpen ) |
|00002b80| 7b 0d 09 09 69 66 20 28 | 20 28 74 68 65 45 72 72 |{...if (| (theErr|
|00002b90| 20 3d 20 50 42 43 6c 6f | 73 65 28 26 6d 79 49 4f | = PBClo|se(&myIO|
|00002ba0| 50 61 72 6d 42 6c 6b 2c | 20 46 41 4c 53 45 29 29 |ParmBlk,| FALSE))|
|00002bb0| 20 21 3d 20 6e 6f 45 72 | 72 20 29 20 7b 20 0d 09 | != noEr|r ) { ..|
|00002bc0| 09 09 4f 53 45 72 72 6f | 72 32 28 22 5c 70 45 72 |..OSErro|r2("\pEr|
|00002bd0| 72 6f 72 20 63 6c 6f 73 | 69 6e 67 20 53 6f 75 6e |ror clos|ing Soun|
|00002be0| 64 20 46 69 6c 65 3a 20 | 22 2c 20 26 53 6f 75 6e |d File: |", &Soun|
|00002bf0| 64 46 69 6c 65 4e 61 6d | 65 2c 20 74 68 65 45 72 |dFileNam|e, theEr|
|00002c00| 72 29 3b 0d 09 09 09 72 | 65 74 75 72 6e 28 46 41 |r);....r|eturn(FA|
|00002c10| 4c 53 45 29 3b 0d 09 09 | 7d 0d 09 09 66 50 42 2e |LSE);...|}...fPB.|
|00002c20| 69 6f 43 6f 6d 70 6c 65 | 74 69 6f 6e 20 3d 20 28 |ioComple|tion = (|
|00002c30| 50 72 6f 63 50 74 72 29 | 4e 49 4c 3b 0d 09 09 66 |ProcPtr)|NIL;...f|
|00002c40| 50 42 2e 69 6f 4e 61 6d | 65 50 74 72 20 3d 20 6d |PB.ioNam|ePtr = m|
|00002c50| 79 49 4f 50 61 72 6d 42 | 6c 6b 2e 69 6f 4e 61 6d |yIOParmB|lk.ioNam|
|00002c60| 65 50 74 72 3b 0d 09 09 | 66 50 42 2e 69 6f 56 52 |ePtr;...|fPB.ioVR|
|00002c70| 65 66 4e 75 6d 20 3d 20 | 6d 79 49 4f 50 61 72 6d |efNum = |myIOParm|
|00002c80| 42 6c 6b 2e 69 6f 56 52 | 65 66 4e 75 6d 3b 0d 09 |Blk.ioVR|efNum;..|
|00002c90| 09 66 50 42 2e 69 6f 46 | 56 65 72 73 4e 75 6d 20 |.fPB.ioF|VersNum |
|00002ca0| 3d 20 6d 79 49 4f 50 61 | 72 6d 42 6c 6b 2e 69 6f |= myIOPa|rmBlk.io|
|00002cb0| 56 65 72 73 4e 75 6d 3b | 0d 09 09 66 50 42 2e 69 |VersNum;|...fPB.i|
|00002cc0| 6f 46 44 69 72 49 6e 64 | 65 78 20 3d 20 4e 49 4c |oFDirInd|ex = NIL|
|00002cd0| 3b 0d 09 09 69 66 20 28 | 20 28 74 68 65 45 72 72 |;...if (| (theErr|
|00002ce0| 20 3d 20 09 50 42 46 6c | 75 73 68 56 6f 6c 28 26 | = .PBFl|ushVol(&|
|00002cf0| 66 50 42 2c 20 46 41 4c | 53 45 29 29 20 21 3d 20 |fPB, FAL|SE)) != |
|00002d00| 6e 6f 45 72 72 20 29 20 | 7b 20 0d 09 09 09 4f 53 |noErr ) |{ ....OS|
|00002d10| 45 72 72 6f 72 32 28 22 | 5c 70 45 72 72 6f 72 20 |Error2("|\pError |
|00002d20| 72 65 74 75 72 6e 65 64 | 20 66 72 6f 6d 20 50 42 |returned| from PB|
|00002d30| 46 6c 75 73 68 56 6f 6c | 20 66 6f 72 20 73 61 6d |FlushVol| for sam|
|00002d40| 70 6c 65 20 66 69 6c 65 | 27 73 20 76 6f 6c 75 6d |ple file|'s volum|
|00002d50| 65 3a 20 22 2c 20 22 22 | 2c 20 74 68 65 45 72 72 |e: ", ""|, theErr|
|00002d60| 29 3b 0d 09 09 09 72 65 | 74 75 72 6e 28 46 41 4c |);....re|turn(FAL|
|00002d70| 53 45 29 3b 0d 09 09 7d | 0d 09 7d 0d 09 0d 09 69 |SE);...}|..}....i|
|00002d80| 66 20 28 20 4f 46 69 6c | 65 4f 70 65 6e 20 29 20 |f ( OFil|eOpen ) |
|00002d90| 7b 0d 09 09 69 66 20 28 | 20 28 74 68 65 45 72 72 |{...if (| (theErr|
|00002da0| 20 3d 20 50 42 43 6c 6f | 73 65 28 26 4e 65 77 50 | = PBClo|se(&NewP|
|00002db0| 61 72 6d 42 6c 6b 2c 20 | 46 41 4c 53 45 29 29 20 |armBlk, |FALSE)) |
|00002dc0| 21 3d 20 6e 6f 45 72 72 | 20 29 20 7b 20 0d 09 09 |!= noErr| ) { ...|
|00002dd0| 09 4f 53 45 72 72 6f 72 | 32 28 22 5c 70 45 72 72 |.OSError|2("\pErr|
|00002de0| 6f 72 20 63 6c 6f 73 69 | 6e 67 20 53 6f 75 6e 64 |or closi|ng Sound|
|00002df0| 20 46 69 6c 65 3a 20 22 | 2c 20 26 53 6f 75 6e 64 | File: "|, &Sound|
|00002e00| 46 69 6c 65 4e 61 6d 65 | 2c 20 74 68 65 45 72 72 |FileName|, theErr|
|00002e10| 29 3b 0d 09 09 09 72 65 | 74 75 72 6e 28 46 41 4c |);....re|turn(FAL|
|00002e20| 53 45 29 3b 0d 09 09 7d | 0d 09 09 66 50 42 2e 69 |SE);...}|...fPB.i|
|00002e30| 6f 43 6f 6d 70 6c 65 74 | 69 6f 6e 20 3d 20 28 50 |oComplet|ion = (P|
|00002e40| 72 6f 63 50 74 72 29 4e | 49 4c 3b 0d 09 09 66 50 |rocPtr)N|IL;...fP|
|00002e50| 42 2e 69 6f 4e 61 6d 65 | 50 74 72 20 3d 20 4e 65 |B.ioName|Ptr = Ne|
|00002e60| 77 50 61 72 6d 42 6c 6b | 2e 69 6f 4e 61 6d 65 50 |wParmBlk|.ioNameP|
|00002e70| 74 72 3b 0d 09 09 66 50 | 42 2e 69 6f 56 52 65 66 |tr;...fP|B.ioVRef|
|00002e80| 4e 75 6d 20 3d 20 4e 65 | 77 50 61 72 6d 42 6c 6b |Num = Ne|wParmBlk|
|00002e90| 2e 69 6f 56 52 65 66 4e | 75 6d 3b 0d 09 09 66 50 |.ioVRefN|um;...fP|
|00002ea0| 42 2e 69 6f 46 56 65 72 | 73 4e 75 6d 20 3d 20 4e |B.ioFVer|sNum = N|
|00002eb0| 65 77 50 61 72 6d 42 6c | 6b 2e 69 6f 56 65 72 73 |ewParmBl|k.ioVers|
|00002ec0| 4e 75 6d 3b 0d 09 09 66 | 50 42 2e 69 6f 46 44 69 |Num;...f|PB.ioFDi|
|00002ed0| 72 49 6e 64 65 78 20 3d | 20 4e 49 4c 3b 0d 09 09 |rIndex =| NIL;...|
|00002ee0| 69 66 20 28 20 28 74 68 | 65 45 72 72 20 3d 20 09 |if ( (th|eErr = .|
|00002ef0| 50 42 46 6c 75 73 68 56 | 6f 6c 28 26 66 50 42 2c |PBFlushV|ol(&fPB,|
|00002f00| 20 46 41 4c 53 45 29 29 | 20 21 3d 20 6e 6f 45 72 | FALSE))| != noEr|
|00002f10| 72 20 29 20 7b 20 0d 09 | 09 09 4f 53 45 72 72 6f |r ) { ..|..OSErro|
|00002f20| 72 32 28 22 5c 70 45 72 | 72 6f 72 20 72 65 74 75 |r2("\pEr|ror retu|
|00002f30| 72 6e 65 64 20 66 72 6f | 6d 20 50 42 46 6c 75 73 |rned fro|m PBFlus|
|00002f40| 68 56 6f 6c 20 66 6f 72 | 20 73 61 6d 70 6c 65 20 |hVol for| sample |
|00002f50| 66 69 6c 65 27 73 20 76 | 6f 6c 75 6d 65 3a 20 22 |file's v|olume: "|
|00002f60| 2c 20 22 22 2c 20 74 68 | 65 45 72 72 29 3b 0d 09 |, "", th|eErr);..|
|00002f70| 09 09 72 65 74 75 72 6e | 28 46 41 4c 53 45 29 3b |..return|(FALSE);|
|00002f80| 0d 09 09 7d 0d 09 7d 0d | 09 72 65 74 75 72 6e 28 |...}..}.|.return(|
|00002f90| 54 52 55 45 29 3b 0d 7d | 0d 0d 0d 42 6f 6f 6c 65 |TRUE);.}|...Boole|
|00002fa0| 61 6e 09 53 65 74 53 46 | 44 69 72 28 44 69 72 4e |an.SetSF|Dir(DirN|
|00002fb0| 61 6d 65 2c 20 74 68 65 | 44 69 72 49 44 29 0d 09 |ame, the|DirID)..|
|00002fc0| 53 74 72 32 35 35 09 09 | 44 69 72 4e 61 6d 65 3b |Str255..|DirName;|
|00002fd0| 0d 09 6c 6f 6e 67 09 09 | 2a 74 68 65 44 69 72 49 |..long..|*theDirI|
|00002fe0| 44 3b 0d 7b 0d 09 65 78 | 74 65 72 6e 09 09 69 6e |D;.{..ex|tern..in|
|00002ff0| 74 09 09 09 53 46 53 61 | 76 65 56 52 65 66 3b 0d |t...SFSa|veVRef;.|
|00003000| 09 65 78 74 65 72 6e 09 | 09 69 6e 74 09 09 09 52 |.extern.|.int...R|
|00003010| 65 70 6f 72 74 46 69 6c | 65 52 65 66 4e 75 6d 3b |eportFil|eRefNum;|
|00003020| 0d 09 53 74 72 32 35 35 | 09 09 61 53 74 72 69 6e |..Str255|..aStrin|
|00003030| 67 3b 0d 09 0d 09 0d 09 | 50 73 74 72 69 6e 67 43 |g;......|PstringC|
|00003040| 6f 70 79 28 28 63 68 61 | 72 20 2a 29 61 53 74 72 |opy((cha|r *)aStr|
|00003050| 69 6e 67 2c 20 44 69 72 | 4e 61 6d 65 29 3b 0d 09 |ing, Dir|Name);..|
|00003060| 6d 79 57 44 50 61 72 61 | 6d 42 6c 6b 2e 69 6f 4e |myWDPara|mBlk.ioN|
|00003070| 61 6d 65 50 74 72 20 3d | 20 28 53 74 72 69 6e 67 |amePtr =| (String|
|00003080| 50 74 72 29 61 53 74 72 | 69 6e 67 3b 0d 09 6d 79 |Ptr)aStr|ing;..my|
|00003090| 57 44 50 61 72 61 6d 42 | 6c 6b 2e 69 6f 43 6f 6d |WDParamB|lk.ioCom|
|000030a0| 70 6c 65 74 69 6f 6e 20 | 3d 20 4e 49 4c 3b 0d 09 |pletion |= NIL;..|
|000030b0| 6d 79 57 44 50 61 72 61 | 6d 42 6c 6b 2e 69 6f 56 |myWDPara|mBlk.ioV|
|000030c0| 52 65 66 4e 75 6d 20 3d | 20 30 3b 0d 09 6d 79 57 |RefNum =| 0;..myW|
|000030d0| 44 50 61 72 61 6d 42 6c | 6b 2e 69 6f 57 44 44 69 |DParamBl|k.ioWDDi|
|000030e0| 72 49 44 20 3d 20 4e 49 | 4c 3b 0d 0d 09 69 66 20 |rID = NI|L;...if |
|000030f0| 28 20 28 74 68 65 45 72 | 72 20 3d 20 50 42 48 53 |( (theEr|r = PBHS|
|00003100| 65 74 56 6f 6c 28 26 6d | 79 57 44 50 61 72 61 6d |etVol(&m|yWDParam|
|00003110| 42 6c 6b 2c 20 46 41 4c | 53 45 29 29 20 21 3d 20 |Blk, FAL|SE)) != |
|00003120| 6e 6f 45 72 72 20 29 20 | 7b 0d 2f 2a 09 09 4f 53 |noErr ) |{./*..OS|
|00003130| 45 72 72 6f 72 32 28 22 | 5c 70 53 65 74 53 46 44 |Error2("|\pSetSFD|
|00003140| 69 72 20 65 72 72 6f 72 | 3a 20 50 42 48 53 65 74 |ir error|: PBHSet|
|00003150| 56 6f 6c 22 2c 20 6d 79 | 57 44 50 61 72 61 6d 42 |Vol", my|WDParamB|
|00003160| 6c 6b 2e 69 6f 4e 61 6d | 65 50 74 72 2c 20 28 6c |lk.ioNam|ePtr, (l|
|00003170| 6f 6e 67 29 74 68 65 45 | 72 72 29 3b 0d 09 09 72 |ong)theE|rr);...r|
|00003180| 65 74 75 72 6e 28 46 41 | 4c 53 45 29 3b 0d 2a 2f |eturn(FA|LSE);.*/|
|00003190| 0d 09 7d 0d 09 0d 09 50 | 42 48 47 65 74 56 6f 6c |..}....P|BHGetVol|
|000031a0| 28 26 6d 79 57 44 50 61 | 72 61 6d 42 6c 6b 2c 20 |(&myWDPa|ramBlk, |
|000031b0| 46 41 4c 53 45 29 3b 0d | 0d 09 2a 74 68 65 44 69 |FALSE);.|..*theDi|
|000031c0| 72 49 44 20 3d 20 6d 79 | 57 44 50 61 72 61 6d 42 |rID = my|WDParamB|
|000031d0| 6c 6b 2e 69 6f 57 44 44 | 69 72 49 44 3b 0d 09 43 |lk.ioWDD|irID;..C|
|000031e0| 75 72 44 69 72 53 74 6f | 72 65 20 3d 20 2a 74 68 |urDirSto|re = *th|
|000031f0| 65 44 69 72 49 44 3b 0d | 09 0d 09 53 46 53 61 76 |eDirID;.|...SFSav|
|00003200| 65 56 52 65 66 20 3d 20 | 6d 79 57 44 50 61 72 61 |eVRef = |myWDPara|
|00003210| 6d 42 6c 6b 2e 69 6f 56 | 52 65 66 4e 75 6d 3b 0d |mBlk.ioV|RefNum;.|
|00003220| 09 53 46 53 61 76 65 44 | 69 73 6b 20 3d 20 2d 31 |.SFSaveD|isk = -1|
|00003230| 20 2a 20 53 46 53 61 76 | 65 56 52 65 66 3b 0d 09 | * SFSav|eVRef;..|
|00003240| 72 65 74 75 72 6e 28 54 | 52 55 45 29 3b 0d 7d 0d |return(T|RUE);.}.|
|00003250| 0d 0d 0d 42 6f 6f 6c 65 | 61 6e 09 47 65 74 53 46 |...Boole|an.GetSF|
|00003260| 44 69 72 28 44 69 72 4e | 61 6d 65 29 0d 09 53 74 |Dir(DirN|ame)..St|
|00003270| 72 32 35 35 09 2a 44 69 | 72 4e 61 6d 65 3b 0d 7b |r255.*Di|rName;.{|
|00003280| 0d 09 53 74 72 32 35 35 | 09 09 6d 79 53 74 72 3b |..Str255|..myStr;|
|00003290| 0d 09 57 44 50 42 52 65 | 63 09 09 6d 79 57 44 50 |..WDPBRe|c..myWDP|
|000032a0| 61 72 61 6d 42 6c 6b 3b | 0d 09 44 69 72 49 6e 66 |aramBlk;|..DirInf|
|000032b0| 6f 09 09 6d 79 43 61 74 | 49 6e 66 6f 42 6c 6b 3b |o..myCat|InfoBlk;|
|000032c0| 0d 09 0d 09 6d 79 43 61 | 74 49 6e 66 6f 42 6c 6b |....myCa|tInfoBlk|
|000032d0| 2e 69 6f 43 6f 6d 70 6c | 65 74 69 6f 6e 20 3d 20 |.ioCompl|etion = |
|000032e0| 4e 49 4c 3b 0d 09 6d 79 | 43 61 74 49 6e 66 6f 42 |NIL;..my|CatInfoB|
|000032f0| 6c 6b 2e 69 6f 56 52 65 | 66 4e 75 6d 20 3d 20 2d |lk.ioVRe|fNum = -|
|00003300| 53 46 53 61 76 65 44 69 | 73 6b 3b 0d 09 6d 79 43 |SFSaveDi|sk;..myC|
|00003310| 61 74 49 6e 66 6f 42 6c | 6b 2e 69 6f 44 72 44 69 |atInfoBl|k.ioDrDi|
|00003320| 72 49 44 20 3d 20 43 75 | 72 44 69 72 53 74 6f 72 |rID = Cu|rDirStor|
|00003330| 65 3b 0d 09 6d 79 43 61 | 74 49 6e 66 6f 42 6c 6b |e;..myCa|tInfoBlk|
|00003340| 2e 69 6f 46 44 69 72 49 | 6e 64 65 78 20 3d 20 2d |.ioFDirI|ndex = -|
|00003350| 31 3b 0d 09 6d 79 43 61 | 74 49 6e 66 6f 42 6c 6b |1;..myCa|tInfoBlk|
|00003360| 2e 69 6f 4e 61 6d 65 50 | 74 72 20 3d 20 28 53 74 |.ioNameP|tr = (St|
|00003370| 72 69 6e 67 50 74 72 29 | 6d 79 53 74 72 3b 0d 09 |ringPtr)|myStr;..|
|00003380| 69 66 20 28 20 28 74 68 | 65 45 72 72 20 3d 20 50 |if ( (th|eErr = P|
|00003390| 42 47 65 74 43 61 74 49 | 6e 66 6f 28 26 6d 79 43 |BGetCatI|nfo(&myC|
|000033a0| 61 74 49 6e 66 6f 42 6c | 6b 2c 20 46 41 4c 53 45 |atInfoBl|k, FALSE|
|000033b0| 29 29 20 21 3d 20 6e 6f | 45 72 72 20 29 20 7b 0d |)) != no|Err ) {.|
|000033c0| 09 09 4f 53 45 72 72 6f | 72 32 28 22 5c 70 50 42 |..OSErro|r2("\pPB|
|000033d0| 47 65 74 43 61 74 49 6e | 66 6f 22 2c 20 6d 79 43 |GetCatIn|fo", myC|
|000033e0| 61 74 49 6e 66 6f 42 6c | 6b 2e 69 6f 4e 61 6d 65 |atInfoBl|k.ioName|
|000033f0| 50 74 72 2c 20 28 6c 6f | 6e 67 29 74 68 65 45 72 |Ptr, (lo|ng)theEr|
|00003400| 72 29 3b 0d 09 09 72 65 | 74 75 72 6e 28 46 41 4c |r);...re|turn(FAL|
|00003410| 53 45 29 3b 0d 09 7d 0d | 09 0d 09 50 73 74 72 69 |SE);..}.|...Pstri|
|00003420| 6e 67 43 6f 70 79 28 44 | 69 72 4e 61 6d 65 2c 20 |ngCopy(D|irName, |
|00003430| 28 63 68 61 72 20 2a 29 | 6d 79 53 74 72 29 3b 0d |(char *)|myStr);.|
|00003440| 09 50 73 74 72 69 6e 67 | 43 61 74 28 44 69 72 4e |.Pstring|Cat(DirN|
|00003450| 61 6d 65 2c 20 22 5c 70 | 3a 22 29 3b 0d 09 0d 09 |ame, "\p|:");....|
|00003460| 77 68 69 6c 65 20 28 6d | 79 43 61 74 49 6e 66 6f |while (m|yCatInfo|
|00003470| 42 6c 6b 2e 69 6f 44 72 | 44 69 72 49 44 20 21 3d |Blk.ioDr|DirID !=|
|00003480| 20 32 20 29 20 7b 0d 09 | 09 6d 79 43 61 74 49 6e | 2 ) {..|.myCatIn|
|00003490| 66 6f 42 6c 6b 2e 69 6f | 44 72 44 69 72 49 44 20 |foBlk.io|DrDirID |
|000034a0| 3d 20 6d 79 43 61 74 49 | 6e 66 6f 42 6c 6b 2e 69 |= myCatI|nfoBlk.i|
|000034b0| 6f 44 72 50 61 72 49 44 | 3b 0d 09 09 69 66 20 28 |oDrParID|;...if (|
|000034c0| 20 28 74 68 65 45 72 72 | 20 3d 20 50 42 47 65 74 | (theErr| = PBGet|
|000034d0| 43 61 74 49 6e 66 6f 28 | 26 6d 79 43 61 74 49 6e |CatInfo(|&myCatIn|
|000034e0| 66 6f 42 6c 6b 2c 20 46 | 41 4c 53 45 29 29 20 21 |foBlk, F|ALSE)) !|
|000034f0| 3d 20 6e 6f 45 72 72 20 | 29 20 7b 0d 09 09 09 4f |= noErr |) {....O|
|00003500| 53 45 72 72 6f 72 32 28 | 22 5c 70 50 42 47 65 74 |SError2(|"\pPBGet|
|00003510| 43 61 74 49 6e 66 6f 22 | 2c 20 6d 79 43 61 74 49 |CatInfo"|, myCatI|
|00003520| 6e 66 6f 42 6c 6b 2e 69 | 6f 4e 61 6d 65 50 74 72 |nfoBlk.i|oNamePtr|
|00003530| 2c 20 28 6c 6f 6e 67 29 | 74 68 65 45 72 72 29 3b |, (long)|theErr);|
|00003540| 0d 09 09 09 72 65 74 75 | 72 6e 28 46 41 4c 53 45 |....retu|rn(FALSE|
|00003550| 29 3b 0d 09 09 7d 0d 09 | 09 50 73 74 72 69 6e 67 |);...}..|.Pstring|
|00003560| 43 61 74 28 28 63 68 61 | 72 20 2a 29 6d 79 53 74 |Cat((cha|r *)mySt|
|00003570| 72 2c 20 22 5c 70 3a 22 | 29 3b 0d 09 09 50 73 74 |r, "\p:"|);...Pst|
|00003580| 72 69 6e 67 43 61 74 28 | 28 63 68 61 72 20 2a 29 |ringCat(|(char *)|
|00003590| 6d 79 53 74 72 2c 20 44 | 69 72 4e 61 6d 65 29 3b |myStr, D|irName);|
|000035a0| 0d 09 09 50 73 74 72 69 | 6e 67 43 6f 70 79 28 44 |...Pstri|ngCopy(D|
|000035b0| 69 72 4e 61 6d 65 2c 20 | 28 63 68 61 72 20 2a 29 |irName, |(char *)|
|000035c0| 6d 79 53 74 72 29 3b 0d | 09 7d 0d 09 43 75 72 44 |myStr);.|.}..CurD|
|000035d0| 69 72 53 74 6f 72 65 20 | 3d 20 6d 79 43 61 74 49 |irStore |= myCatI|
|000035e0| 6e 66 6f 42 6c 6b 2e 69 | 6f 44 72 44 69 72 49 44 |nfoBlk.i|oDrDirID|
|000035f0| 3b 0d 09 0d 09 72 65 74 | 75 72 6e 28 54 52 55 45 |;....ret|urn(TRUE|
|00003600| 29 3b 0d 7d 0d 0d 0d 0d | 0d 0d 74 79 70 65 64 65 |);.}....|..typede|
|00003610| 66 09 73 74 72 75 63 74 | 20 7b 0d 09 69 6e 74 09 |f.struct| {..int.|
|00003620| 09 09 09 09 6e 73 74 72 | 69 6e 67 73 3b 0d 09 53 |....nstr|ings;..S|
|00003630| 74 72 32 35 35 09 09 74 | 68 65 53 74 72 69 6e 67 |tr255..t|heString|
|00003640| 73 3b 0d 7d 20 52 65 73 | 44 61 74 75 6d 3b 0d 0d |s;.} Res|Datum;..|
|00003650| 42 6f 6f 6c 65 61 6e 09 | 75 70 64 61 74 65 4e 65 |Boolean.|updateNe|
|00003660| 77 53 46 52 65 73 46 69 | 6c 65 28 29 0d 7b 09 0d |wSFResFi|le().{..|
|00003670| 09 52 65 73 44 61 74 75 | 6d 09 09 09 09 2a 2a 6e |.ResDatu|m....**n|
|00003680| 65 77 53 66 52 65 73 3b | 0d 09 53 74 72 69 6e 67 |ewSfRes;|..String|
|00003690| 48 61 6e 64 6c 65 09 09 | 09 6d 79 53 74 72 69 6e |Handle..|.myStrin|
|000036a0| 67 48 61 6e 64 6c 65 30 | 2c 20 6d 79 53 74 72 69 |gHandle0|, myStri|
|000036b0| 6e 67 48 61 6e 64 6c 65 | 31 2c 20 6d 79 53 74 72 |ngHandle|1, myStr|
|000036c0| 69 6e 67 48 61 6e 64 6c | 65 32 2c 20 6d 79 53 74 |ingHandl|e2, mySt|
|000036d0| 72 69 6e 67 48 61 6e 64 | 6c 65 33 3b 0d 09 53 74 |ringHand|le3;..St|
|000036e0| 72 69 6e 67 50 74 72 09 | 09 73 74 72 70 74 72 3b |ringPtr.|.strptr;|
|000036f0| 0d 09 53 74 72 32 35 35 | 09 09 09 09 6d 79 53 74 |..Str255|....mySt|
|00003700| 72 69 6e 67 3b 0d 09 65 | 78 74 65 72 6e 09 09 69 |ring;..e|xtern..i|
|00003710| 6e 74 09 09 09 53 6f 75 | 6e 64 46 69 6c 65 54 79 |nt...Sou|ndFileTy|
|00003720| 70 65 3b 0d 09 65 78 74 | 65 72 6e 09 09 69 6e 74 |pe;..ext|ern..int|
|00003730| 09 09 53 46 4f 55 54 50 | 55 54 74 79 70 65 3b 0d |..SFOUTP|UTtype;.|
|00003740| 09 65 78 74 65 72 6e 09 | 09 6c 6f 6e 67 09 09 09 |.extern.|.long...|
|00003750| 4e 75 6d 43 68 61 6e 6e | 65 6c 73 3b 0d 09 65 78 |NumChann|els;..ex|
|00003760| 74 65 72 6e 09 09 64 6f | 75 62 6c 65 09 09 4d 61 |tern..do|uble..Ma|
|00003770| 78 53 61 6d 70 6c 65 3b | 0d 09 65 78 74 65 72 6e |xSample;|..extern|
|00003780| 09 09 64 6f 75 62 6c 65 | 09 09 4d 69 6e 53 61 6d |..double|..MinSam|
|00003790| 70 6c 65 3b 0d 09 65 78 | 74 65 72 6e 09 09 6c 6f |ple;..ex|tern..lo|
|000037a0| 6e 67 09 09 09 53 61 6d | 70 6c 65 52 61 74 65 3b |ng...Sam|pleRate;|
|000037b0| 0d 09 69 6e 74 09 09 09 | 09 09 4e 73 66 52 65 73 |..int...|..NsfRes|
|000037c0| 46 69 6c 65 52 65 66 4e | 75 6d 3b 0d 09 69 6e 74 |FileRefN|um;..int|
|000037d0| 09 09 09 09 09 69 3b 0d | 09 0d 09 2f 2a 20 6f 70 |.....i;.|.../* op|
|000037e0| 65 6e 20 74 68 65 20 72 | 65 73 6f 75 72 63 65 20 |en the r|esource |
|000037f0| 66 6f 72 6b 20 2a 2f 0d | 09 43 72 65 61 74 65 52 |fork */.|.CreateR|
|00003800| 65 73 46 69 6c 65 28 4e | 65 77 53 6f 75 6e 64 46 |esFile(N|ewSoundF|
|00003810| 69 6c 65 4e 61 6d 65 29 | 3b 0d 09 69 66 20 28 20 |ileName)|;..if ( |
|00003820| 28 20 74 68 65 45 72 72 | 20 3d 20 52 65 73 45 72 |( theErr| = ResEr|
|00003830| 72 6f 72 28 29 29 20 21 | 3d 20 6e 6f 45 72 72 20 |ror()) !|= noErr |
|00003840| 29 20 7b 0d 09 09 4f 53 | 45 72 72 6f 72 32 28 22 |) {...OS|Error2("|
|00003850| 5c 70 4f 70 65 6e 53 46 | 57 72 69 74 65 3a 20 43 |\pOpenSF|Write: C|
|00003860| 72 65 61 74 65 52 65 73 | 46 69 6c 65 20 65 72 72 |reateRes|File err|
|00003870| 6f 72 3a 20 22 2c 20 4e | 65 77 53 6f 75 6e 64 46 |or: ", N|ewSoundF|
|00003880| 69 6c 65 4e 61 6d 65 2c | 20 74 68 65 45 72 72 29 |ileName,| theErr)|
|00003890| 3b 0d 09 09 72 65 74 75 | 72 6e 28 46 41 4c 53 45 |;...retu|rn(FALSE|
|000038a0| 29 3b 0d 09 7d 0d 09 0d | 09 4e 73 66 52 65 73 46 |);..}...|.NsfResF|
|000038b0| 69 6c 65 52 65 66 4e 75 | 6d 20 3d 20 4f 70 65 6e |ileRefNu|m = Open|
|000038c0| 52 65 73 46 69 6c 65 28 | 4e 65 77 53 6f 75 6e 64 |ResFile(|NewSound|
|000038d0| 46 69 6c 65 4e 61 6d 65 | 29 3b 0d 09 69 66 20 28 |FileName|);..if (|
|000038e0| 20 28 20 74 68 65 45 72 | 72 20 3d 20 52 65 73 45 | ( theEr|r = ResE|
|000038f0| 72 72 6f 72 28 29 29 20 | 21 3d 20 6e 6f 45 72 72 |rror()) |!= noErr|
|00003900| 20 29 20 7b 0d 09 09 4f | 53 45 72 72 6f 72 32 28 | ) {...O|SError2(|
|00003910| 22 5c 70 75 70 64 61 74 | 65 4e 65 77 53 46 52 65 |"\pupdat|eNewSFRe|
|00003920| 73 46 69 6c 65 3a 20 4f | 70 65 6e 52 65 73 46 69 |sFile: O|penResFi|
|00003930| 6c 65 20 65 72 72 6f 72 | 3a 20 22 2c 20 4e 65 77 |le error|: ", New|
|00003940| 53 6f 75 6e 64 46 69 6c | 65 4e 61 6d 65 2c 20 74 |SoundFil|eName, t|
|00003950| 68 65 45 72 72 29 3b 0d | 09 09 72 65 74 75 72 6e |heErr);.|..return|
|00003960| 28 46 41 4c 53 45 29 3b | 0d 09 7d 0d 0d 09 6e 65 |(FALSE);|..}...ne|
|00003970| 77 53 66 52 65 73 20 3d | 20 28 52 65 73 44 61 74 |wSfRes =| (ResDat|
|00003980| 75 6d 20 2a 2a 29 20 4e | 65 77 48 61 6e 64 6c 65 |um **) N|ewHandle|
|00003990| 28 73 69 7a 65 6f 66 28 | 52 65 73 44 61 74 75 6d |(sizeof(|ResDatum|
|000039a0| 29 29 3b 0d 09 48 4c 6f | 63 6b 28 6e 65 77 53 66 |));..HLo|ck(newSf|
|000039b0| 52 65 73 29 3b 0d 09 0d | 09 28 2a 2a 6e 65 77 53 |Res);...|.(**newS|
|000039c0| 66 52 65 73 29 2e 6e 73 | 74 72 69 6e 67 73 20 3d |fRes).ns|trings =|
|000039d0| 20 35 3b 0d 0d 09 73 74 | 72 70 74 72 20 3d 20 28 | 5;...st|rptr = (|
|000039e0| 2a 6e 65 77 53 66 52 65 | 73 29 2d 3e 74 68 65 53 |*newSfRe|s)->theS|
|000039f0| 74 72 69 6e 67 73 3b 0d | 09 0d 09 73 77 69 74 63 |trings;.|...switc|
|00003a00| 68 28 53 46 4f 55 54 50 | 55 54 74 79 70 65 29 20 |h(SFOUTP|UTtype) |
|00003a10| 7b 0d 09 09 63 61 73 65 | 09 49 4e 54 31 36 3a 0d |{...case|.INT16:.|
|00003a20| 09 09 09 50 73 74 72 69 | 6e 67 43 6f 70 79 28 73 |...Pstri|ngCopy(s|
|00003a30| 74 72 70 74 72 2c 20 22 | 5c 70 49 4e 54 31 36 22 |trptr, "|\pINT16"|
|00003a40| 29 3b 0d 09 09 09 73 74 | 72 70 74 72 20 2b 3d 20 |);....st|rptr += |
|00003a50| 28 2a 73 74 72 70 74 72 | 29 20 2b 20 31 3b 0d 09 |(*strptr|) + 1;..|
|00003a60| 09 09 62 72 65 61 6b 3b | 0d 09 09 63 61 73 65 09 |..break;|...case.|
|00003a70| 41 49 46 46 3a 0d 09 09 | 09 50 73 74 72 69 6e 67 |AIFF:...|.Pstring|
|00003a80| 43 6f 70 79 28 73 74 72 | 70 74 72 2c 20 22 5c 70 |Copy(str|ptr, "\p|
|00003a90| 41 49 46 46 22 29 3b 0d | 09 09 09 73 74 72 70 74 |AIFF");.|...strpt|
|00003aa0| 72 20 2b 3d 20 28 2a 73 | 74 72 70 74 72 29 20 2b |r += (*s|trptr) +|
|00003ab0| 20 31 3b 0d 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 | 1;....b|reak;...|
|00003ac0| 63 61 73 65 09 53 44 31 | 3a 0d 09 09 09 50 73 74 |case.SD1|:....Pst|
|00003ad0| 72 69 6e 67 43 6f 70 79 | 28 73 74 72 70 74 72 2c |ringCopy|(strptr,|
|00003ae0| 20 22 5c 70 53 44 22 29 | 3b 0d 09 09 09 73 74 72 | "\pSD")|;....str|
|00003af0| 70 74 72 20 2b 3d 20 28 | 2a 73 74 72 70 74 72 29 |ptr += (|*strptr)|
|00003b00| 20 2b 20 31 3b 0d 09 09 | 09 62 72 65 61 6b 3b 0d | + 1;...|.break;.|
|00003b10| 09 09 63 61 73 65 09 53 | 44 32 3a 0d 09 09 09 50 |..case.S|D2:....P|
|00003b20| 73 74 72 69 6e 67 43 6f | 70 79 28 73 74 72 70 74 |stringCo|py(strpt|
|00003b30| 72 2c 20 22 5c 70 53 44 | 32 22 29 3b 0d 09 09 09 |r, "\pSD|2");....|
|00003b40| 73 74 72 70 74 72 20 2b | 3d 20 28 2a 73 74 72 70 |strptr +|= (*strp|
|00003b50| 74 72 29 20 2b 20 31 3b | 0d 09 09 09 62 72 65 61 |tr) + 1;|....brea|
|00003b60| 6b 3b 0d 09 09 63 61 73 | 65 09 46 4c 4f 41 54 3a |k;...cas|e.FLOAT:|
|00003b70| 0d 09 09 09 50 73 74 72 | 69 6e 67 43 6f 70 79 28 |....Pstr|ingCopy(|
|00003b80| 73 74 72 70 74 72 2c 20 | 22 5c 70 46 4c 4f 41 54 |strptr, |"\pFLOAT|
|00003b90| 22 29 3b 0d 09 09 09 73 | 74 72 70 74 72 20 2b 3d |");....s|trptr +=|
|00003ba0| 20 28 2a 73 74 72 70 74 | 72 29 20 2b 20 31 3b 0d | (*strpt|r) + 1;.|
|00003bb0| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 64 65 66 61 |...break|;...defa|
|00003bc0| 75 6c 74 3a 0d 09 09 09 | 50 73 74 72 69 6e 67 43 |ult:....|PstringC|
|00003bd0| 6f 70 79 28 73 74 72 70 | 74 72 2c 20 22 5c 70 49 |opy(strp|tr, "\pI|
|00003be0| 4e 54 31 36 22 29 3b 0d | 09 09 09 73 74 72 70 74 |NT16");.|...strpt|
|00003bf0| 72 20 2b 3d 20 28 2a 73 | 74 72 70 74 72 29 20 2b |r += (*s|trptr) +|
|00003c00| 20 31 3b 0d 09 09 09 62 | 72 65 61 6b 3b 0d 09 7d | 1;....b|reak;..}|
|00003c10| 0d 09 0d 09 0d 09 69 66 | 20 28 20 4e 75 6d 43 68 |......if| ( NumCh|
|00003c20| 61 6e 6e 65 6c 73 20 3c | 20 31 20 29 0d 09 09 4e |annels <| 1 )...N|
|00003c30| 75 6d 43 68 61 6e 6e 65 | 6c 73 20 3d 20 31 3b 0d |umChanne|ls = 1;.|
|00003c40| 09 4e 75 6d 54 6f 53 74 | 72 69 6e 67 28 4e 75 6d |.NumToSt|ring(Num|
|00003c50| 43 68 61 6e 6e 65 6c 73 | 2c 20 26 6d 79 53 74 72 |Channels|, &myStr|
|00003c60| 69 6e 67 29 3b 0d 09 50 | 73 74 72 69 6e 67 43 6f |ing);..P|stringCo|
|00003c70| 70 79 28 73 74 72 70 74 | 72 2c 20 28 63 68 61 72 |py(strpt|r, (char|
|00003c80| 20 2a 29 6d 79 53 74 72 | 69 6e 67 29 3b 0d 09 73 | *)myStr|ing);..s|
|00003c90| 74 72 70 74 72 20 2b 3d | 20 28 2a 73 74 72 70 74 |trptr +=| (*strpt|
|00003ca0| 72 29 20 2b 20 31 3b 0d | 0d 09 4e 75 6d 54 6f 53 |r) + 1;.|..NumToS|
|00003cb0| 74 72 69 6e 67 28 53 61 | 6d 70 6c 65 52 61 74 65 |tring(Sa|mpleRate|
|00003cc0| 2c 20 26 6d 79 53 74 72 | 69 6e 67 29 3b 0d 09 50 |, &myStr|ing);..P|
|00003cd0| 73 74 72 69 6e 67 43 6f | 70 79 28 73 74 72 70 74 |stringCo|py(strpt|
|00003ce0| 72 2c 20 28 63 68 61 72 | 20 2a 29 6d 79 53 74 72 |r, (char| *)myStr|
|00003cf0| 69 6e 67 29 3b 0d 09 73 | 74 72 70 74 72 20 2b 3d |ing);..s|trptr +=|
|00003d00| 20 28 2a 73 74 72 70 74 | 72 29 20 2b 20 31 3b 0d | (*strpt|r) + 1;.|
|00003d10| 09 0d 09 69 20 3d 20 73 | 70 72 69 6e 74 66 28 28 |...i = s|printf((|
|00003d20| 63 68 61 72 20 2a 29 6d | 79 53 74 72 69 6e 67 2c |char *)m|yString,|
|00003d30| 20 22 25 6c 66 22 2c 20 | 28 64 6f 75 62 6c 65 29 | "%lf", |(double)|
|00003d40| 4d 61 78 53 61 6d 70 6c | 65 29 3b 0d 09 43 74 6f |MaxSampl|e);..Cto|
|00003d50| 50 73 74 72 28 28 63 68 | 61 72 20 2a 29 6d 79 53 |Pstr((ch|ar *)myS|
|00003d60| 74 72 69 6e 67 29 3b 0d | 09 50 73 74 72 69 6e 67 |tring);.|.Pstring|
|00003d70| 43 6f 70 79 28 73 74 72 | 70 74 72 2c 20 28 63 68 |Copy(str|ptr, (ch|
|00003d80| 61 72 20 2a 29 6d 79 53 | 74 72 69 6e 67 29 3b 0d |ar *)myS|tring);.|
|00003d90| 09 73 74 72 70 74 72 20 | 2b 3d 20 28 2a 73 74 72 |.strptr |+= (*str|
|00003da0| 70 74 72 29 20 2b 20 31 | 3b 0d 09 0d 09 69 20 3d |ptr) + 1|;....i =|
|00003db0| 20 73 70 72 69 6e 74 66 | 28 28 63 68 61 72 20 2a | sprintf|((char *|
|00003dc0| 29 6d 79 53 74 72 69 6e | 67 2c 20 22 25 6c 66 22 |)myStrin|g, "%lf"|
|00003dd0| 2c 20 28 64 6f 75 62 6c | 65 29 4d 69 6e 53 61 6d |, (doubl|e)MinSam|
|00003de0| 70 6c 65 29 3b 0d 09 43 | 74 6f 50 73 74 72 28 28 |ple);..C|toPstr((|
|00003df0| 63 68 61 72 20 2a 29 6d | 79 53 74 72 69 6e 67 29 |char *)m|yString)|
|00003e00| 3b 0d 09 50 73 74 72 69 | 6e 67 43 6f 70 79 28 73 |;..Pstri|ngCopy(s|
|00003e10| 74 72 70 74 72 2c 20 28 | 63 68 61 72 20 2a 29 6d |trptr, (|char *)m|
|00003e20| 79 53 74 72 69 6e 67 29 | 3b 0d 0d 09 0d 09 41 64 |yString)|;.....Ad|
|00003e30| 64 52 65 73 6f 75 72 63 | 65 28 6e 65 77 53 66 52 |dResourc|e(newSfR|
|00003e40| 65 73 2c 20 27 53 54 52 | 23 27 2c 20 53 46 52 45 |es, 'STR|#', SFRE|
|00003e50| 53 4f 55 52 43 45 4e 55 | 4d 2c 20 22 5c 70 53 46 |SOURCENU|M, "\pSF|
|00003e60| 20 70 61 72 61 6d 73 22 | 29 3b 0d 09 69 66 20 28 | params"|);..if (|
|00003e70| 28 74 68 65 45 72 72 20 | 3d 20 52 65 73 45 72 72 |(theErr |= ResErr|
|00003e80| 6f 72 28 29 29 20 21 3d | 20 6e 6f 45 72 72 29 20 |or()) !=| noErr) |
|00003e90| 7b 0d 09 09 4f 53 45 72 | 72 6f 72 32 28 22 5c 70 |{...OSEr|ror2("\p|
|00003ea0| 41 64 64 52 65 73 6f 75 | 72 63 65 20 65 72 72 6f |AddResou|rce erro|
|00003eb0| 72 20 69 6e 20 75 70 64 | 61 74 65 4e 65 77 53 46 |r in upd|ateNewSF|
|00003ec0| 52 65 73 46 69 6c 65 28 | 29 22 2c 20 4e 49 4c 2c |ResFile(|)", NIL,|
|00003ed0| 20 74 68 65 45 72 72 29 | 3b 0d 09 09 48 55 6e 6c | theErr)|;...HUnl|
|00003ee0| 6f 63 6b 28 6e 65 77 53 | 66 52 65 73 29 3b 0d 09 |ock(newS|fRes);..|
|00003ef0| 09 44 69 73 70 6f 73 48 | 61 6e 64 6c 65 28 6e 65 |.DisposH|andle(ne|
|00003f00| 77 53 66 52 65 73 29 3b | 0d 09 09 72 65 74 75 72 |wSfRes);|...retur|
|00003f10| 6e 28 46 41 4c 53 45 29 | 3b 0d 09 7d 0d 09 43 68 |n(FALSE)|;..}..Ch|
|00003f20| 61 6e 67 65 64 52 65 73 | 6f 75 72 63 65 28 6e 65 |angedRes|ource(ne|
|00003f30| 77 53 66 52 65 73 29 3b | 0d 09 69 66 20 28 20 28 |wSfRes);|..if ( (|
|00003f40| 74 68 65 45 72 72 20 3d | 20 52 65 73 45 72 72 6f |theErr =| ResErro|
|00003f50| 72 28 29 29 20 21 3d 20 | 6e 6f 45 72 72 20 29 20 |r()) != |noErr ) |
|00003f60| 7b 0d 09 09 4f 53 45 72 | 72 6f 72 32 28 22 5c 70 |{...OSEr|ror2("\p|
|00003f70| 43 68 61 6e 67 65 64 52 | 65 73 6f 75 72 63 65 20 |ChangedR|esource |
|00003f80| 65 72 72 6f 72 20 69 6e | 20 75 70 64 61 74 65 4e |error in| updateN|
|00003f90| 65 77 53 46 52 65 73 46 | 69 6c 65 28 29 22 2c 20 |ewSFResF|ile()", |
|00003fa0| 4e 65 77 53 6f 75 6e 64 | 46 69 6c 65 4e 61 6d 65 |NewSound|FileName|
|00003fb0| 2c 20 74 68 65 45 72 72 | 29 3b 0d 09 09 48 55 6e |, theErr|);...HUn|
|00003fc0| 6c 6f 63 6b 28 6e 65 77 | 53 66 52 65 73 29 3b 0d |lock(new|SfRes);.|
|00003fd0| 09 09 44 69 73 70 6f 73 | 48 61 6e 64 6c 65 28 6e |..Dispos|Handle(n|
|00003fe0| 65 77 53 66 52 65 73 29 | 3b 0d 09 09 72 65 74 75 |ewSfRes)|;...retu|
|00003ff0| 72 6e 28 46 41 4c 53 45 | 29 3b 0d 09 7d 0d 09 57 |rn(FALSE|);..}..W|
|00004000| 72 69 74 65 52 65 73 6f | 75 72 63 65 28 6e 65 77 |riteReso|urce(new|
|00004010| 53 66 52 65 73 29 3b 0d | 09 69 66 20 28 20 28 74 |SfRes);.|.if ( (t|
|00004020| 68 65 45 72 72 20 3d 20 | 52 65 73 45 72 72 6f 72 |heErr = |ResError|
|00004030| 28 29 29 20 21 3d 20 6e | 6f 45 72 72 20 29 20 7b |()) != n|oErr ) {|
|00004040| 0d 09 09 4f 53 45 72 72 | 6f 72 32 28 22 5c 70 57 |...OSErr|or2("\pW|
|00004050| 72 69 74 65 52 65 73 6f | 75 72 63 65 20 65 72 72 |riteReso|urce err|
|00004060| 6f 72 20 69 6e 20 75 70 | 64 61 74 65 4e 65 77 53 |or in up|dateNewS|
|00004070| 46 52 65 73 46 69 6c 65 | 28 29 22 2c 20 4e 65 77 |FResFile|()", New|
|00004080| 53 6f 75 6e 64 46 69 6c | 65 4e 61 6d 65 2c 20 74 |SoundFil|eName, t|
|00004090| 68 65 45 72 72 29 3b 0d | 09 09 48 55 6e 6c 6f 63 |heErr);.|..HUnloc|
|000040a0| 6b 28 6e 65 77 53 66 52 | 65 73 29 3b 0d 09 09 44 |k(newSfR|es);...D|
|000040b0| 69 73 70 6f 73 48 61 6e | 64 6c 65 28 6e 65 77 53 |isposHan|dle(newS|
|000040c0| 66 52 65 73 29 3b 0d 09 | 09 72 65 74 75 72 6e 28 |fRes);..|.return(|
|000040d0| 46 41 4c 53 45 29 3b 0d | 09 7d 0d 09 0d 09 0d 09 |FALSE);.|.}......|
|000040e0| 2f 2a 61 64 64 20 53 44 | 32 20 72 65 73 6f 75 72 |/*add SD|2 resour|
|000040f0| 63 65 73 20 2a 2f 0d 09 | 69 66 20 28 20 53 46 4f |ces */..|if ( SFO|
|00004100| 55 54 50 55 54 74 79 70 | 65 20 3d 3d 20 53 44 32 |UTPUTtyp|e == SD2|
|00004110| 20 29 20 7b 0d 09 09 6d | 79 53 74 72 69 6e 67 48 | ) {...m|yStringH|
|00004120| 61 6e 64 6c 65 31 20 3d | 20 28 53 74 72 69 6e 67 |andle1 =| (String|
|00004130| 48 61 6e 64 6c 65 29 4e | 65 77 48 61 6e 64 6c 65 |Handle)N|ewHandle|
|00004140| 28 73 69 7a 65 6f 66 28 | 53 74 72 69 6e 67 48 61 |(sizeof(|StringHa|
|00004150| 6e 64 6c 65 29 29 3b 0d | 09 09 69 20 3d 20 73 70 |ndle));.|..i = sp|
|00004160| 72 69 6e 74 66 28 28 63 | 68 61 72 20 2a 29 6d 79 |rintf((c|har *)my|
|00004170| 53 74 72 69 6e 67 2c 20 | 22 25 64 22 2c 20 28 69 |String, |"%d", (i|
|00004180| 6e 74 29 4e 75 6d 43 68 | 61 6e 6e 65 6c 73 29 3b |nt)NumCh|annels);|
|00004190| 0d 09 09 43 74 6f 50 73 | 74 72 28 28 63 68 61 72 |...CtoPs|tr((char|
|000041a0| 20 2a 29 6d 79 53 74 72 | 69 6e 67 29 3b 0d 09 09 | *)myStr|ing);...|
|000041b0| 53 65 74 53 74 72 69 6e | 67 28 6d 79 53 74 72 69 |SetStrin|g(myStri|
|000041c0| 6e 67 48 61 6e 64 6c 65 | 31 2c 20 6d 79 53 74 72 |ngHandle|1, myStr|
|000041d0| 69 6e 67 29 3b 0d 09 09 | 48 4c 6f 63 6b 28 28 48 |ing);...|HLock((H|
|000041e0| 61 6e 64 6c 65 29 6d 79 | 53 74 72 69 6e 67 48 61 |andle)my|StringHa|
|000041f0| 6e 64 6c 65 31 29 3b 0d | 09 09 41 64 64 52 65 73 |ndle1);.|..AddRes|
|00004200| 6f 75 72 63 65 28 28 48 | 61 6e 64 6c 65 29 6d 79 |ource((H|andle)my|
|00004210| 53 74 72 69 6e 67 48 61 | 6e 64 6c 65 31 2c 20 27 |StringHa|ndle1, '|
|00004220| 53 54 52 20 27 2c 20 53 | 41 4d 50 4c 45 5f 43 48 |STR ', S|AMPLE_CH|
|00004230| 41 4e 4e 45 4c 53 5f 52 | 45 53 2c 20 22 5c 70 63 |ANNELS_R|ES, "\pc|
|00004240| 68 61 6e 6e 65 6c 73 22 | 29 3b 0d 09 09 48 55 6e |hannels"|);...HUn|
|00004250| 6c 6f 63 6b 28 28 48 61 | 6e 64 6c 65 29 6d 79 53 |lock((Ha|ndle)myS|
|00004260| 74 72 69 6e 67 48 61 6e | 64 6c 65 31 29 3b 0d 09 |tringHan|dle1);..|
|00004270| 09 0d 09 09 43 68 61 6e | 67 65 64 52 65 73 6f 75 |....Chan|gedResou|
|00004280| 72 63 65 28 28 48 61 6e | 64 6c 65 29 6d 79 53 74 |rce((Han|dle)mySt|
|00004290| 72 69 6e 67 48 61 6e 64 | 6c 65 31 29 3b 0d 09 09 |ringHand|le1);...|
|000042a0| 69 66 20 28 20 28 74 68 | 65 45 72 72 20 3d 20 52 |if ( (th|eErr = R|
|000042b0| 65 73 45 72 72 6f 72 28 | 29 29 20 21 3d 20 6e 6f |esError(|)) != no|
|000042c0| 45 72 72 20 29 20 7b 0d | 09 09 09 4f 53 45 72 72 |Err ) {.|...OSErr|
|000042d0| 6f 72 32 28 22 5c 70 43 | 68 61 6e 67 65 64 52 65 |or2("\pC|hangedRe|
|000042e0| 73 6f 75 72 63 65 20 65 | 72 72 6f 72 20 69 6e 20 |source e|rror in |
|000042f0| 75 70 64 61 74 65 4e 65 | 77 53 46 52 65 73 46 69 |updateNe|wSFResFi|
|00004300| 6c 65 28 29 22 2c 20 4e | 65 77 53 6f 75 6e 64 46 |le()", N|ewSoundF|
|00004310| 69 6c 65 4e 61 6d 65 2c | 20 74 68 65 45 72 72 29 |ileName,| theErr)|
|00004320| 3b 0d 09 09 09 48 55 6e | 6c 6f 63 6b 28 28 48 61 |;....HUn|lock((Ha|
|00004330| 6e 64 6c 65 29 6d 79 53 | 74 72 69 6e 67 48 61 6e |ndle)myS|tringHan|
|00004340| 64 6c 65 31 29 3b 0d 09 | 09 09 44 69 73 70 6f 73 |dle1);..|..Dispos|
|00004350| 48 61 6e 64 6c 65 28 28 | 48 61 6e 64 6c 65 29 6d |Handle((|Handle)m|
|00004360| 79 53 74 72 69 6e 67 48 | 61 6e 64 6c 65 31 29 3b |yStringH|andle1);|
|00004370| 0d 09 09 09 72 65 74 75 | 72 6e 28 46 41 4c 53 45 |....retu|rn(FALSE|
|00004380| 29 3b 0d 09 09 7d 0d 09 | 09 57 72 69 74 65 52 65 |);...}..|.WriteRe|
|00004390| 73 6f 75 72 63 65 28 28 | 48 61 6e 64 6c 65 29 6d |source((|Handle)m|
|000043a0| 79 53 74 72 69 6e 67 48 | 61 6e 64 6c 65 31 29 3b |yStringH|andle1);|
|000043b0| 0d 09 09 69 66 20 28 20 | 28 74 68 65 45 72 72 20 |...if ( |(theErr |
|000043c0| 3d 20 52 65 73 45 72 72 | 6f 72 28 29 29 20 21 3d |= ResErr|or()) !=|
|000043d0| 20 6e 6f 45 72 72 20 29 | 20 7b 0d 09 09 09 4f 53 | noErr )| {....OS|
|000043e0| 45 72 72 6f 72 32 28 22 | 5c 70 57 72 69 74 65 52 |Error2("|\pWriteR|
|000043f0| 65 73 6f 75 72 63 65 20 | 65 72 72 6f 72 20 69 6e |esource |error in|
|00004400| 20 75 70 64 61 74 65 4e | 65 77 53 46 52 65 73 46 | updateN|ewSFResF|
|00004410| 69 6c 65 28 29 22 2c 20 | 4e 65 77 53 6f 75 6e 64 |ile()", |NewSound|
|00004420| 46 69 6c 65 4e 61 6d 65 | 2c 20 74 68 65 45 72 72 |FileName|, theErr|
|00004430| 29 3b 0d 09 09 09 48 55 | 6e 6c 6f 63 6b 28 28 48 |);....HU|nlock((H|
|00004440| 61 6e 64 6c 65 29 6d 79 | 53 74 72 69 6e 67 48 61 |andle)my|StringHa|
|00004450| 6e 64 6c 65 31 29 3b 0d | 09 09 09 44 69 73 70 6f |ndle1);.|...Dispo|
|00004460| 73 48 61 6e 64 6c 65 28 | 28 48 61 6e 64 6c 65 29 |sHandle(|(Handle)|
|00004470| 6d 79 53 74 72 69 6e 67 | 48 61 6e 64 6c 65 31 29 |myString|Handle1)|
|00004480| 3b 0d 09 09 09 72 65 74 | 75 72 6e 28 46 41 4c 53 |;....ret|urn(FALS|
|00004490| 45 29 3b 0d 09 09 7d 0d | 0d 09 09 6d 79 53 74 72 |E);...}.|...myStr|
|000044a0| 69 6e 67 48 61 6e 64 6c | 65 32 20 3d 20 28 53 74 |ingHandl|e2 = (St|
|000044b0| 72 69 6e 67 48 61 6e 64 | 6c 65 29 4e 65 77 48 61 |ringHand|le)NewHa|
|000044c0| 6e 64 6c 65 28 73 69 7a | 65 6f 66 28 53 74 72 69 |ndle(siz|eof(Stri|
|000044d0| 6e 67 48 61 6e 64 6c 65 | 29 29 3b 0d 09 09 69 20 |ngHandle|));...i |
|000044e0| 3d 20 73 70 72 69 6e 74 | 66 28 28 63 68 61 72 20 |= sprint|f((char |
|000044f0| 2a 29 6d 79 53 74 72 69 | 6e 67 2c 20 22 25 6c 64 |*)myStri|ng, "%ld|
|00004500| 22 2c 20 28 6c 6f 6e 67 | 29 53 61 6d 70 6c 65 52 |", (long|)SampleR|
|00004510| 61 74 65 29 3b 0d 09 09 | 43 74 6f 50 73 74 72 28 |ate);...|CtoPstr(|
|00004520| 28 63 68 61 72 20 2a 29 | 6d 79 53 74 72 69 6e 67 |(char *)|myString|
|00004530| 29 3b 0d 09 09 53 65 74 | 53 74 72 69 6e 67 28 6d |);...Set|String(m|
|00004540| 79 53 74 72 69 6e 67 48 | 61 6e 64 6c 65 32 2c 20 |yStringH|andle2, |
|00004550| 6d 79 53 74 72 69 6e 67 | 29 3b 0d 09 09 48 4c 6f |myString|);...HLo|
|00004560| 63 6b 28 28 48 61 6e 64 | 6c 65 29 6d 79 53 74 72 |ck((Hand|le)myStr|
|00004570| 69 6e 67 48 61 6e 64 6c | 65 32 29 3b 0d 09 09 41 |ingHandl|e2);...A|
|00004580| 64 64 52 65 73 6f 75 72 | 63 65 28 28 48 61 6e 64 |ddResour|ce((Hand|
|00004590| 6c 65 29 6d 79 53 74 72 | 69 6e 67 48 61 6e 64 6c |le)myStr|ingHandl|
|000045a0| 65 32 2c 20 27 53 54 52 | 20 27 2c 20 53 41 4d 50 |e2, 'STR| ', SAMP|
|000045b0| 4c 45 5f 52 41 54 45 5f | 52 45 53 2c 20 22 5c 70 |LE_RATE_|RES, "\p|
|000045c0| 73 61 6d 70 6c 65 2d 72 | 61 74 65 22 29 3b 0d 09 |sample-r|ate");..|
|000045d0| 09 48 55 6e 6c 6f 63 6b | 28 28 48 61 6e 64 6c 65 |.HUnlock|((Handle|
|000045e0| 29 6d 79 53 74 72 69 6e | 67 48 61 6e 64 6c 65 32 |)myStrin|gHandle2|
|000045f0| 29 3b 0d 0d 09 09 43 68 | 61 6e 67 65 64 52 65 73 |);....Ch|angedRes|
|00004600| 6f 75 72 63 65 28 28 48 | 61 6e 64 6c 65 29 6d 79 |ource((H|andle)my|
|00004610| 53 74 72 69 6e 67 48 61 | 6e 64 6c 65 32 29 3b 0d |StringHa|ndle2);.|
|00004620| 09 09 69 66 20 28 20 28 | 74 68 65 45 72 72 20 3d |..if ( (|theErr =|
|00004630| 20 52 65 73 45 72 72 6f | 72 28 29 29 20 21 3d 20 | ResErro|r()) != |
|00004640| 6e 6f 45 72 72 20 29 20 | 7b 0d 09 09 09 4f 53 45 |noErr ) |{....OSE|
|00004650| 72 72 6f 72 32 28 22 5c | 70 43 68 61 6e 67 65 64 |rror2("\|pChanged|
|00004660| 52 65 73 6f 75 72 63 65 | 20 65 72 72 6f 72 20 69 |Resource| error i|
|00004670| 6e 20 75 70 64 61 74 65 | 4e 65 77 53 46 52 65 73 |n update|NewSFRes|
|00004680| 46 69 6c 65 28 29 22 2c | 20 4e 65 77 53 6f 75 6e |File()",| NewSoun|
|00004690| 64 46 69 6c 65 4e 61 6d | 65 2c 20 74 68 65 45 72 |dFileNam|e, theEr|
|000046a0| 72 29 3b 0d 09 09 09 48 | 55 6e 6c 6f 63 6b 28 28 |r);....H|Unlock((|
|000046b0| 48 61 6e 64 6c 65 29 6d | 79 53 74 72 69 6e 67 48 |Handle)m|yStringH|
|000046c0| 61 6e 64 6c 65 32 29 3b | 0d 09 09 09 44 69 73 70 |andle2);|....Disp|
|000046d0| 6f 73 48 61 6e 64 6c 65 | 28 28 48 61 6e 64 6c 65 |osHandle|((Handle|
|000046e0| 29 6d 79 53 74 72 69 6e | 67 48 61 6e 64 6c 65 32 |)myStrin|gHandle2|
|000046f0| 29 3b 0d 09 09 09 72 65 | 74 75 72 6e 28 46 41 4c |);....re|turn(FAL|
|00004700| 53 45 29 3b 0d 09 09 7d | 0d 09 09 57 72 69 74 65 |SE);...}|...Write|
|00004710| 52 65 73 6f 75 72 63 65 | 28 28 48 61 6e 64 6c 65 |Resource|((Handle|
|00004720| 29 6d 79 53 74 72 69 6e | 67 48 61 6e 64 6c 65 32 |)myStrin|gHandle2|
|00004730| 29 3b 0d 09 09 69 66 20 | 28 20 28 74 68 65 45 72 |);...if |( (theEr|
|00004740| 72 20 3d 20 52 65 73 45 | 72 72 6f 72 28 29 29 20 |r = ResE|rror()) |
|00004750| 21 3d 20 6e 6f 45 72 72 | 20 29 20 7b 0d 09 09 09 |!= noErr| ) {....|
|00004760| 4f 53 45 72 72 6f 72 32 | 28 22 5c 70 57 72 69 74 |OSError2|("\pWrit|
|00004770| 65 52 65 73 6f 75 72 63 | 65 20 65 72 72 6f 72 20 |eResourc|e error |
|00004780| 69 6e 20 75 70 64 61 74 | 65 4e 65 77 53 46 52 65 |in updat|eNewSFRe|
|00004790| 73 46 69 6c 65 28 29 22 | 2c 20 4e 65 77 53 6f 75 |sFile()"|, NewSou|
|000047a0| 6e 64 46 69 6c 65 4e 61 | 6d 65 2c 20 74 68 65 45 |ndFileNa|me, theE|
|000047b0| 72 72 29 3b 0d 09 09 09 | 48 55 6e 6c 6f 63 6b 28 |rr);....|HUnlock(|
|000047c0| 28 48 61 6e 64 6c 65 29 | 6d 79 53 74 72 69 6e 67 |(Handle)|myString|
|000047d0| 48 61 6e 64 6c 65 32 29 | 3b 0d 09 09 09 44 69 73 |Handle2)|;....Dis|
|000047e0| 70 6f 73 48 61 6e 64 6c | 65 28 28 48 61 6e 64 6c |posHandl|e((Handl|
|000047f0| 65 29 6d 79 53 74 72 69 | 6e 67 48 61 6e 64 6c 65 |e)myStri|ngHandle|
|00004800| 32 29 3b 0d 09 09 09 72 | 65 74 75 72 6e 28 46 41 |2);....r|eturn(FA|
|00004810| 4c 53 45 29 3b 0d 09 09 | 7d 0d 0d 0d 0d 09 09 6d |LSE);...|}......m|
|00004820| 79 53 74 72 69 6e 67 48 | 61 6e 64 6c 65 33 20 3d |yStringH|andle3 =|
|00004830| 20 28 53 74 72 69 6e 67 | 48 61 6e 64 6c 65 29 4e | (String|Handle)N|
|00004840| 65 77 48 61 6e 64 6c 65 | 28 73 69 7a 65 6f 66 28 |ewHandle|(sizeof(|
|00004850| 53 74 72 69 6e 67 48 61 | 6e 64 6c 65 29 29 3b 0d |StringHa|ndle));.|
|00004860| 09 09 53 65 74 53 74 72 | 69 6e 67 28 6d 79 53 74 |..SetStr|ing(mySt|
|00004870| 72 69 6e 67 48 61 6e 64 | 6c 65 33 2c 20 22 5c 70 |ringHand|le3, "\p|
|00004880| 32 22 29 3b 0d 09 09 48 | 4c 6f 63 6b 28 28 48 61 |2");...H|Lock((Ha|
|00004890| 6e 64 6c 65 29 6d 79 53 | 74 72 69 6e 67 48 61 6e |ndle)myS|tringHan|
|000048a0| 64 6c 65 33 29 3b 0d 09 | 09 41 64 64 52 65 73 6f |dle3);..|.AddReso|
|000048b0| 75 72 63 65 28 28 48 61 | 6e 64 6c 65 29 6d 79 53 |urce((Ha|ndle)myS|
|000048c0| 74 72 69 6e 67 48 61 6e | 64 6c 65 33 2c 20 27 53 |tringHan|dle3, 'S|
|000048d0| 54 52 20 27 2c 20 53 41 | 4d 50 4c 45 5f 53 49 5a |TR ', SA|MPLE_SIZ|
|000048e0| 45 5f 52 45 53 2c 20 22 | 5c 70 73 61 6d 70 6c 65 |E_RES, "|\psample|
|000048f0| 2d 73 69 7a 65 22 29 3b | 0d 09 09 48 55 6e 6c 6f |-size");|...HUnlo|
|00004900| 63 6b 28 28 48 61 6e 64 | 6c 65 29 6d 79 53 74 72 |ck((Hand|le)myStr|
|00004910| 69 6e 67 48 61 6e 64 6c | 65 33 29 3b 0d 0d 09 09 |ingHandl|e3);....|
|00004920| 69 66 20 28 28 74 68 65 | 45 72 72 20 3d 20 52 65 |if ((the|Err = Re|
|00004930| 73 45 72 72 6f 72 28 29 | 29 20 21 3d 20 6e 6f 45 |sError()|) != noE|
|00004940| 72 72 29 20 7b 0d 09 09 | 09 4f 53 45 72 72 6f 72 |rr) {...|.OSError|
|00004950| 32 28 22 5c 70 41 64 64 | 52 65 73 6f 75 72 63 65 |2("\pAdd|Resource|
|00004960| 20 65 72 72 6f 72 20 69 | 6e 20 75 70 64 61 74 65 | error i|n update|
|00004970| 4e 65 77 53 46 52 65 73 | 46 69 6c 65 28 29 22 2c |NewSFRes|File()",|
|00004980| 20 4e 49 4c 2c 20 74 68 | 65 45 72 72 29 3b 0d 09 | NIL, th|eErr);..|
|00004990| 09 09 48 55 6e 6c 6f 63 | 6b 28 28 48 61 6e 64 6c |..HUnloc|k((Handl|
|000049a0| 65 29 6d 79 53 74 72 69 | 6e 67 48 61 6e 64 6c 65 |e)myStri|ngHandle|
|000049b0| 33 29 3b 0d 09 09 09 44 | 69 73 70 6f 73 48 61 6e |3);....D|isposHan|
|000049c0| 64 6c 65 28 28 48 61 6e | 64 6c 65 29 6d 79 53 74 |dle((Han|dle)mySt|
|000049d0| 72 69 6e 67 48 61 6e 64 | 6c 65 33 29 3b 0d 09 09 |ringHand|le3);...|
|000049e0| 09 72 65 74 75 72 6e 28 | 46 41 4c 53 45 29 3b 0d |.return(|FALSE);.|
|000049f0| 09 09 7d 0d 09 09 43 68 | 61 6e 67 65 64 52 65 73 |..}...Ch|angedRes|
|00004a00| 6f 75 72 63 65 28 28 48 | 61 6e 64 6c 65 29 6d 79 |ource((H|andle)my|
|00004a10| 53 74 72 69 6e 67 48 61 | 6e 64 6c 65 33 29 3b 0d |StringHa|ndle3);.|
|00004a20| 09 09 69 66 20 28 20 28 | 74 68 65 45 72 72 20 3d |..if ( (|theErr =|
|00004a30| 20 52 65 73 45 72 72 6f | 72 28 29 29 20 21 3d 20 | ResErro|r()) != |
|00004a40| 6e 6f 45 72 72 20 29 20 | 7b 0d 09 09 09 4f 53 45 |noErr ) |{....OSE|
|00004a50| 72 72 6f 72 32 28 22 5c | 70 43 68 61 6e 67 65 64 |rror2("\|pChanged|
|00004a60| 52 65 73 6f 75 72 63 65 | 20 65 72 72 6f 72 20 69 |Resource| error i|
|00004a70| 6e 20 75 70 64 61 74 65 | 4e 65 77 53 46 52 65 73 |n update|NewSFRes|
|00004a80| 46 69 6c 65 28 29 22 2c | 20 4e 65 77 53 6f 75 6e |File()",| NewSoun|
|00004a90| 64 46 69 6c 65 4e 61 6d | 65 2c 20 74 68 65 45 72 |dFileNam|e, theEr|
|00004aa0| 72 29 3b 0d 09 09 09 48 | 55 6e 6c 6f 63 6b 28 28 |r);....H|Unlock((|
|00004ab0| 48 61 6e 64 6c 65 29 6d | 79 53 74 72 69 6e 67 48 |Handle)m|yStringH|
|00004ac0| 61 6e 64 6c 65 33 29 3b | 0d 09 09 09 44 69 73 70 |andle3);|....Disp|
|00004ad0| 6f 73 48 61 6e 64 6c 65 | 28 28 48 61 6e 64 6c 65 |osHandle|((Handle|
|00004ae0| 29 6d 79 53 74 72 69 6e | 67 48 61 6e 64 6c 65 33 |)myStrin|gHandle3|
|00004af0| 29 3b 0d 09 09 09 72 65 | 74 75 72 6e 28 46 41 4c |);....re|turn(FAL|
|00004b00| 53 45 29 3b 0d 09 09 7d | 0d 09 09 57 72 69 74 65 |SE);...}|...Write|
|00004b10| 52 65 73 6f 75 72 63 65 | 28 28 48 61 6e 64 6c 65 |Resource|((Handle|
|00004b20| 29 6d 79 53 74 72 69 6e | 67 48 61 6e 64 6c 65 33 |)myStrin|gHandle3|
|00004b30| 29 3b 0d 09 09 69 66 20 | 28 20 28 74 68 65 45 72 |);...if |( (theEr|
|00004b40| 72 20 3d 20 52 65 73 45 | 72 72 6f 72 28 29 29 20 |r = ResE|rror()) |
|00004b50| 21 3d 20 6e 6f 45 72 72 | 20 29 20 7b 0d 09 09 09 |!= noErr| ) {....|
|00004b60| 4f 53 45 72 72 6f 72 32 | 28 22 5c 70 57 72 69 74 |OSError2|("\pWrit|
|00004b70| 65 52 65 73 6f 75 72 63 | 65 20 65 72 72 6f 72 20 |eResourc|e error |
|00004b80| 69 6e 20 75 70 64 61 74 | 65 4e 65 77 53 46 52 65 |in updat|eNewSFRe|
|00004b90| 73 46 69 6c 65 28 29 22 | 2c 20 4e 65 77 53 6f 75 |sFile()"|, NewSou|
|00004ba0| 6e 64 46 69 6c 65 4e 61 | 6d 65 2c 20 74 68 65 45 |ndFileNa|me, theE|
|00004bb0| 72 72 29 3b 0d 09 09 09 | 48 55 6e 6c 6f 63 6b 28 |rr);....|HUnlock(|
|00004bc0| 28 48 61 6e 64 6c 65 29 | 6d 79 53 74 72 69 6e 67 |(Handle)|myString|
|00004bd0| 48 61 6e 64 6c 65 33 29 | 3b 0d 09 09 09 44 69 73 |Handle3)|;....Dis|
|00004be0| 70 6f 73 48 61 6e 64 6c | 65 28 28 48 61 6e 64 6c |posHandl|e((Handl|
|00004bf0| 65 29 6d 79 53 74 72 69 | 6e 67 48 61 6e 64 6c 65 |e)myStri|ngHandle|
|00004c00| 33 29 3b 0d 09 09 09 72 | 65 74 75 72 6e 28 46 41 |3);....r|eturn(FA|
|00004c10| 4c 53 45 29 3b 0d 09 09 | 7d 0d 09 09 48 55 6e 6c |LSE);...|}...HUnl|
|00004c20| 6f 63 6b 28 28 48 61 6e | 64 6c 65 29 6d 79 53 74 |ock((Han|dle)mySt|
|00004c30| 72 69 6e 67 48 61 6e 64 | 6c 65 33 29 3b 0d 09 09 |ringHand|le3);...|
|00004c40| 44 69 73 70 6f 73 48 61 | 6e 64 6c 65 28 28 48 61 |DisposHa|ndle((Ha|
|00004c50| 6e 64 6c 65 29 6d 79 53 | 74 72 69 6e 67 48 61 6e |ndle)myS|tringHan|
|00004c60| 64 6c 65 31 29 3b 0d 09 | 09 44 69 73 70 6f 73 48 |dle1);..|.DisposH|
|00004c70| 61 6e 64 6c 65 28 28 48 | 61 6e 64 6c 65 29 6d 79 |andle((H|andle)my|
|00004c80| 53 74 72 69 6e 67 48 61 | 6e 64 6c 65 32 29 3b 0d |StringHa|ndle2);.|
|00004c90| 09 09 44 69 73 70 6f 73 | 48 61 6e 64 6c 65 28 28 |..Dispos|Handle((|
|00004ca0| 48 61 6e 64 6c 65 29 6d | 79 53 74 72 69 6e 67 48 |Handle)m|yStringH|
|00004cb0| 61 6e 64 6c 65 33 29 3b | 0d 09 09 0d 09 7d 0d 09 |andle3);|.....}..|
|00004cc0| 43 6c 6f 73 65 52 65 73 | 46 69 6c 65 28 4e 73 66 |CloseRes|File(Nsf|
|00004cd0| 52 65 73 46 69 6c 65 52 | 65 66 4e 75 6d 29 3b 0d |ResFileR|efNum);.|
|00004ce0| 09 69 66 20 28 20 28 74 | 68 65 45 72 72 20 3d 20 |.if ( (t|heErr = |
|00004cf0| 52 65 73 45 72 72 6f 72 | 28 29 29 20 21 3d 20 6e |ResError|()) != n|
|00004d00| 6f 45 72 72 20 29 20 7b | 0d 09 09 4f 53 45 72 72 |oErr ) {|...OSErr|
|00004d10| 6f 72 32 28 22 5c 70 43 | 6c 6f 73 65 52 65 73 46 |or2("\pC|loseResF|
|00004d20| 69 6c 65 20 65 72 72 6f | 72 20 69 6e 20 75 70 64 |ile erro|r in upd|
|00004d30| 61 74 65 4e 65 77 53 46 | 52 65 73 46 69 6c 65 28 |ateNewSF|ResFile(|
|00004d40| 29 22 2c 20 4e 65 77 53 | 6f 75 6e 64 46 69 6c 65 |)", NewS|oundFile|
|00004d50| 4e 61 6d 65 2c 20 74 68 | 65 45 72 72 29 3b 0d 09 |Name, th|eErr);..|
|00004d60| 09 72 65 74 75 72 6e 28 | 46 41 4c 53 45 29 3b 0d |.return(|FALSE);.|
|00004d70| 09 7d 0d 09 69 66 20 28 | 20 28 74 68 65 45 72 72 |.}..if (| (theErr|
|00004d80| 20 3d 20 52 65 73 45 72 | 72 6f 72 28 29 29 20 21 | = ResEr|ror()) !|
|00004d90| 3d 20 6e 6f 45 72 72 20 | 29 20 7b 0d 20 09 09 4f |= noErr |) {. ..O|
|00004da0| 53 45 72 72 6f 72 32 28 | 22 5c 70 55 73 65 52 65 |SError2(|"\pUseRe|
|00004db0| 73 46 69 6c 65 20 65 72 | 72 6f 72 20 69 6e 20 75 |sFile er|ror in u|
|00004dc0| 70 64 61 74 65 4e 65 77 | 53 46 52 65 73 46 69 6c |pdateNew|SFResFil|
|00004dd0| 65 28 29 22 2c 20 4e 65 | 77 53 6f 75 6e 64 46 69 |e()", Ne|wSoundFi|
|00004de0| 6c 65 4e 61 6d 65 2c 20 | 74 68 65 45 72 72 29 3b |leName, |theErr);|
|00004df0| 0d 09 09 72 65 74 75 72 | 6e 28 46 41 4c 53 45 29 |...retur|n(FALSE)|
|00004e00| 3b 0d 09 7d 0d 09 50 42 | 46 6c 75 73 68 56 6f 6c |;..}..PB|FlushVol|
|00004e10| 28 26 66 50 42 2c 20 46 | 41 4c 53 45 29 3b 0d 09 |(&fPB, F|ALSE);..|
|00004e20| 72 65 74 75 72 6e 28 54 | 52 55 45 29 3b 0d 7d 0d |return(T|RUE);.}.|
|00004e30| 0d 0d 0d 76 6f 69 64 20 | 47 65 74 4d 75 73 69 63 |...void |GetMusic|
|00004e40| 34 43 5f 50 72 65 66 73 | 28 29 0d 7b 0d 09 69 6e |4C_Prefs|().{..in|
|00004e50| 74 09 09 09 72 65 66 4e | 75 6d 3b 0d 09 53 74 72 |t...refN|um;..Str|
|00004e60| 69 6e 67 50 74 72 09 76 | 6f 6c 4e 61 6d 65 3b 0d |ingPtr.v|olName;.|
|00004e70| 09 63 68 61 72 09 09 62 | 75 66 66 65 72 5b 32 5d |.char..b|uffer[2]|
|00004e80| 3b 0d 09 6c 6f 6e 67 09 | 09 63 6f 75 6e 74 3b 0d |;..long.|.count;.|
|00004e90| 09 53 74 72 32 35 35 09 | 09 46 69 6c 65 46 6f 72 |.Str255.|.FileFor|
|00004ea0| 6d 61 74 3b 0d 09 65 78 | 74 65 72 6e 09 09 53 74 |mat;..ex|tern..St|
|00004eb0| 72 32 35 35 09 09 53 46 | 44 69 72 65 63 74 6f 72 |r255..SF|Director|
|00004ec0| 79 4e 61 6d 65 3b 0d 09 | 65 78 74 65 72 6e 09 09 |yName;..|extern..|
|00004ed0| 53 79 73 45 6e 76 52 65 | 63 09 53 79 73 45 6e 76 |SysEnvRe|c.SysEnv|
|00004ee0| 44 61 74 61 3b 0d 09 69 | 6e 74 09 69 3b 0d 09 0d |Data;..i|nt.i;...|
|00004ef0| 2f 2a 20 22 4d 75 73 69 | 63 34 43 5f 50 72 65 66 |/* "Musi|c4C_Pref|
|00004f00| 73 22 20 69 73 20 6b 65 | 70 74 20 69 6e 20 74 68 |s" is ke|pt in th|
|00004f10| 65 20 53 79 73 74 65 6d | 20 46 6f 6c 64 65 72 20 |e System| Folder |
|00004f20| 2a 2f 0d 09 53 46 44 69 | 72 65 63 74 6f 72 79 4e |*/..SFDi|rectoryN|
|00004f30| 61 6d 65 5b 30 5d 20 3d | 20 30 3b 0d 09 74 68 65 |ame[0] =| 0;..the|
|00004f40| 45 72 72 20 3d 20 46 53 | 4f 70 65 6e 28 22 5c 70 |Err = FS|Open("\p|
|00004f50| 4d 75 73 69 63 34 43 5f | 50 72 65 66 73 22 2c 20 |Music4C_|Prefs", |
|00004f60| 53 79 73 45 6e 76 44 61 | 74 61 2e 73 79 73 56 52 |SysEnvDa|ta.sysVR|
|00004f70| 65 66 4e 75 6d 2c 20 26 | 72 65 66 4e 75 6d 29 3b |efNum, &|refNum);|
|00004f80| 0d 09 69 66 20 28 74 68 | 65 45 72 72 20 3d 3d 20 |..if (th|eErr == |
|00004f90| 6e 6f 45 72 72 29 20 7b | 0d 09 09 63 6f 75 6e 74 |noErr) {|...count|
|00004fa0| 20 3d 20 32 4c 3b 0d 09 | 09 74 68 65 45 72 72 20 | = 2L;..|.theErr |
|00004fb0| 3d 20 46 53 52 65 61 64 | 20 28 72 65 66 4e 75 6d |= FSRead| (refNum|
|00004fc0| 2c 20 26 63 6f 75 6e 74 | 2c 20 26 62 75 66 66 65 |, &count|, &buffe|
|00004fd0| 72 29 3b 0d 09 09 69 66 | 20 28 20 74 68 65 45 72 |r);...if| ( theEr|
|00004fe0| 72 20 21 3d 20 6e 6f 45 | 72 72 20 29 20 7b 0d 09 |r != noE|rr ) {..|
|00004ff0| 09 09 4f 53 45 72 72 6f | 72 28 22 5c 70 45 72 72 |..OSErro|r("\pErr|
|00005000| 6f 72 20 72 65 61 64 69 | 6e 67 20 50 72 65 66 65 |or readi|ng Prefe|
|00005010| 72 65 6e 63 65 73 20 66 | 69 6c 65 22 2c 20 4e 49 |rences f|ile", NI|
|00005020| 4c 29 3b 0d 09 09 7d 0d | 09 09 63 6f 75 6e 74 20 |L);...}.|..count |
|00005030| 3d 20 73 69 7a 65 6f 66 | 28 46 69 6c 65 46 6f 72 |= sizeof|(FileFor|
|00005040| 6d 61 74 29 3b 0d 09 09 | 74 68 65 45 72 72 20 3d |mat);...|theErr =|
|00005050| 20 46 53 52 65 61 64 20 | 28 72 65 66 4e 75 6d 2c | FSRead |(refNum,|
|00005060| 20 26 63 6f 75 6e 74 2c | 20 26 46 69 6c 65 46 6f | &count,| &FileFo|
|00005070| 72 6d 61 74 29 3b 0d 09 | 09 69 66 20 28 20 74 68 |rmat);..|.if ( th|
|00005080| 65 45 72 72 20 21 3d 20 | 6e 6f 45 72 72 20 29 20 |eErr != |noErr ) |
|00005090| 7b 0d 09 09 09 4f 53 45 | 72 72 6f 72 28 22 5c 70 |{....OSE|rror("\p|
|000050a0| 45 72 72 6f 72 20 72 65 | 61 64 69 6e 67 20 50 72 |Error re|ading Pr|
|000050b0| 65 66 65 72 65 6e 63 65 | 73 20 66 69 6c 65 22 2c |eference|s file",|
|000050c0| 20 4e 49 4c 29 3b 0d 09 | 09 7d 0d 09 09 63 6f 75 | NIL);..|.}...cou|
|000050d0| 6e 74 20 3d 20 73 69 7a | 65 6f 66 28 53 46 44 69 |nt = siz|eof(SFDi|
|000050e0| 72 65 63 74 6f 72 79 4e | 61 6d 65 29 3b 0d 09 09 |rectoryN|ame);...|
|000050f0| 74 68 65 45 72 72 20 3d | 20 46 53 52 65 61 64 20 |theErr =| FSRead |
|00005100| 28 72 65 66 4e 75 6d 2c | 20 26 63 6f 75 6e 74 2c |(refNum,| &count,|
|00005110| 20 26 53 46 44 69 72 65 | 63 74 6f 72 79 4e 61 6d | &SFDire|ctoryNam|
|00005120| 65 29 3b 0d 09 09 69 66 | 20 28 20 74 68 65 45 72 |e);...if| ( theEr|
|00005130| 72 20 21 3d 20 6e 6f 45 | 72 72 20 29 20 7b 0d 09 |r != noE|rr ) {..|
|00005140| 09 09 4f 53 45 72 72 6f | 72 28 22 5c 70 45 72 72 |..OSErro|r("\pErr|
|00005150| 6f 72 20 72 65 61 64 69 | 6e 67 20 50 72 65 66 65 |or readi|ng Prefe|
|00005160| 72 65 6e 63 65 73 20 66 | 69 6c 65 22 2c 20 4e 49 |rences f|ile", NI|
|00005170| 4c 29 3b 0d 09 09 7d 0d | 09 09 74 68 65 45 72 72 |L);...}.|..theErr|
|00005180| 20 3d 20 46 53 43 6c 6f | 73 65 28 72 65 66 4e 75 | = FSClo|se(refNu|
|00005190| 6d 29 3b 0d 09 7d 0d 7d | 0d 00 00 00 00 00 00 00 |m);..}.}|........|
|000051a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005200| 00 00 01 00 00 00 01 16 | 00 00 00 16 00 00 00 46 |........|.......F|
|00005210| d5 00 00 00 0e 0d 63 6f | 64 65 20 6f 76 65 72 66 |......co|de overf|
|00005220| 6c 6f 77 00 00 00 26 25 | 66 6c 6f 61 74 69 6e 67 |low...&%|floating|
|00005230| 0f 53 46 43 6f 6e 76 65 | 72 74 46 69 6c 65 2e 63 |.SFConve|rtFile.c|
|00005240| 02 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005260| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005270| 00 00 a3 14 39 16 00 00 | 00 00 00 00 01 5c 6f 70 |....9...|.....\op|
|00005280| 65 72 61 74 6f 72 00 00 | 00 1e 1d 63 61 6e d5 74 |erator..|...can.t|
|00005290| 20 70 72 65 63 6f 6d 70 | 69 6c 65 20 63 6f 64 65 | precomp|ile code|
|000052a0| 20 6f 72 20 64 61 74 61 | 00 00 00 15 14 64 65 62 | or data|.....deb|
|000052b0| 75 67 20 74 61 62 6c 65 | 20 6f 76 65 72 66 6c 6f |ug table| overflo|
|000052c0| 77 00 00 00 2b 2a 6d 65 | 6d 6f 72 79 20 63 72 69 |w...+*me|mory cri|
|000052d0| 74 69 63 61 6c 20 2d 20 | 70 72 6f 63 65 65 64 20 |tical - |proceed |
|000052e0| 61 74 20 79 6f 75 72 20 | 6f 77 6e 20 72 69 73 6b |at your |own risk|
|000052f0| 00 00 00 15 00 64 00 4a | 01 10 01 b6 00 01 00 00 |.....d.J|........|
|00005300| 00 00 00 04 00 06 00 04 | 00 00 00 0a 00 0a 07 43 |........|.......C|
|00005310| 6f 75 72 69 65 72 00 00 | 01 00 00 00 01 16 00 00 |ourier..|........|
|00005320| 00 16 00 00 00 46 00 29 | 2c c0 05 26 00 00 00 1c |.....F.)|,..&....|
|00005330| 00 46 00 01 45 54 41 42 | 00 00 00 12 45 46 4e 54 |.F..ETAB|....EFNT|
|00005340| 00 00 00 1e 03 ec ff ff | 00 00 00 00 00 29 2b d8 |........|.....)+.|
|00005350| 03 eb ff ff 00 00 00 08 | 00 29 2c 00 00 00 00 00 |........|.),.....|
|00005360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+